reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83
   84
   85
   86
   87
   88
   89
   90
   91
   92
   93
   94
   95
   96
   97
   98
   99
  100
  101
  102
  103
  104
  105
  106
  107
  108
  109
  110
  111
  112
  113
  114
  115
  116
  117
  118
  119
  120
  121
  122
  123
  124
  125
  126
  127
  128
  129
  130
  131
  132
  133
  134
  135
  136
  137
  138
  139
  140
  141
  142
  143
  144
  145
  146
  147
  148
  149
  150
  151
  152
  153
  154
  155
  156
  157
  158
  159
  160
  161
  162
  163
  164
  165
  166
  167
  168
  169
  170
  171
  172
  173
  174
  175
  176
  177
  178
  179
  180
  181
  182
  183
  184
  185
  186
  187
  188
  189
//===-- LangStandards.def - Language Standard Data --------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LANGSTANDARD
#error "LANGSTANDARD must be defined before including this file"
#endif

/// LANGSTANDARD(IDENT, NAME, LANG, DESC, FEATURES)
///
/// \param IDENT - The name of the standard as a C++ identifier.
/// \param NAME - The name of the standard.
/// \param LANG - The Language for which this is a standard.
/// \param DESC - A short description of the standard.
/// \param FEATURES - The standard features as flags, these are enums from the
/// clang::frontend namespace, which is assumed to be be available.

/// LANGSTANDARD_ALIAS(IDENT, ALIAS)
/// \param IDENT - The name of the standard as a C++ identifier.
/// \param ALIAS - The alias of the standard.

/// LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS)
/// Same as LANGSTANDARD_ALIAS, but for a deprecated alias.

#ifndef LANGSTANDARD_ALIAS
#define LANGSTANDARD_ALIAS(IDENT, ALIAS)
#endif

#ifndef LANGSTANDARD_ALIAS_DEPR
#define LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS) LANGSTANDARD_ALIAS(IDENT, ALIAS)
#endif

// C89-ish modes.
LANGSTANDARD(c89, "c89",
             C, "ISO C 1990",
             ImplicitInt)
LANGSTANDARD_ALIAS(c89, "c90")
LANGSTANDARD_ALIAS(c89, "iso9899:1990")

LANGSTANDARD(c94, "iso9899:199409",
             C, "ISO C 1990 with amendment 1",
             Digraphs | ImplicitInt)

LANGSTANDARD(gnu89, "gnu89",
             C, "ISO C 1990 with GNU extensions",
             LineComment | Digraphs | GNUMode | ImplicitInt)
LANGSTANDARD_ALIAS(gnu89, "gnu90")

// C99-ish modes
LANGSTANDARD(c99, "c99",
             C, "ISO C 1999",
             LineComment | C99 | Digraphs | HexFloat)
LANGSTANDARD_ALIAS(c99, "iso9899:1999")
LANGSTANDARD_ALIAS_DEPR(c99, "c9x")
LANGSTANDARD_ALIAS_DEPR(c99, "iso9899:199x")

LANGSTANDARD(gnu99, "gnu99",
             C, "ISO C 1999 with GNU extensions",
             LineComment | C99 | Digraphs | GNUMode | HexFloat)
LANGSTANDARD_ALIAS_DEPR(gnu99, "gnu9x")

// C11 modes
LANGSTANDARD(c11, "c11",
             C, "ISO C 2011",
             LineComment | C99 | C11 | Digraphs | HexFloat)
LANGSTANDARD_ALIAS(c11, "iso9899:2011")
LANGSTANDARD_ALIAS_DEPR(c11, "c1x")
LANGSTANDARD_ALIAS_DEPR(c11, "iso9899:201x")

LANGSTANDARD(gnu11, "gnu11",
             C, "ISO C 2011 with GNU extensions",
             LineComment | C99 | C11 | Digraphs | GNUMode | HexFloat)
LANGSTANDARD_ALIAS_DEPR(gnu11, "gnu1x")

// C17 modes
LANGSTANDARD(c17, "c17",
             C, "ISO C 2017",
             LineComment | C99 | C11 | C17 | Digraphs | HexFloat)
LANGSTANDARD_ALIAS(c17, "iso9899:2017")
LANGSTANDARD_ALIAS(c17, "c18")
LANGSTANDARD_ALIAS(c17, "iso9899:2018")
LANGSTANDARD(gnu17, "gnu17",
             C, "ISO C 2017 with GNU extensions",
             LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat)
LANGSTANDARD_ALIAS(gnu17, "gnu18")

// C2x modes
LANGSTANDARD(c2x, "c2x",
             C, "Working Draft for ISO C2x",
             LineComment | C99 | C11 | C17 | C2x | Digraphs | HexFloat)
LANGSTANDARD(gnu2x, "gnu2x",
             C, "Working Draft for ISO C2x with GNU extensions",
             LineComment | C99 | C11 | C17 | C2x | Digraphs | GNUMode | HexFloat)

// C++ modes
LANGSTANDARD(cxx98, "c++98",
             CXX, "ISO C++ 1998 with amendments",
             LineComment | CPlusPlus | Digraphs)
LANGSTANDARD_ALIAS(cxx98, "c++03")

LANGSTANDARD(gnucxx98, "gnu++98",
             CXX, "ISO C++ 1998 with amendments and GNU extensions",
             LineComment | CPlusPlus | Digraphs | GNUMode)
LANGSTANDARD_ALIAS(gnucxx98, "gnu++03")

LANGSTANDARD(cxx11, "c++11",
             CXX, "ISO C++ 2011 with amendments",
             LineComment | CPlusPlus | CPlusPlus11 | Digraphs)
LANGSTANDARD_ALIAS_DEPR(cxx11, "c++0x")

LANGSTANDARD(gnucxx11, "gnu++11", CXX,
             "ISO C++ 2011 with amendments and GNU extensions",
             LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode)
LANGSTANDARD_ALIAS_DEPR(gnucxx11, "gnu++0x")

LANGSTANDARD(cxx14, "c++14",
             CXX, "ISO C++ 2014 with amendments",
             LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs)
LANGSTANDARD_ALIAS_DEPR(cxx14, "c++1y")

LANGSTANDARD(gnucxx14, "gnu++14",
             CXX, "ISO C++ 2014 with amendments and GNU extensions",
             LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs |
             GNUMode)
LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y")

LANGSTANDARD(cxx17, "c++17",
             CXX, "ISO C++ 2017 with amendments",
             LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
             Digraphs | HexFloat)
LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z")

LANGSTANDARD(gnucxx17, "gnu++17",
             CXX, "ISO C++ 2017 with amendments and GNU extensions",
             LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
             Digraphs | HexFloat | GNUMode)
LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z")

LANGSTANDARD(cxx2a, "c++2a",
             CXX, "Working draft for ISO C++ 2020",
             LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
             CPlusPlus2a | Digraphs | HexFloat)

LANGSTANDARD(gnucxx2a, "gnu++2a",
             CXX, "Working draft for ISO C++ 2020 with GNU extensions",
             LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
             CPlusPlus2a | Digraphs | HexFloat | GNUMode)

// OpenCL
LANGSTANDARD(opencl10, "cl1.0",
             OpenCL, "OpenCL 1.0",
             LineComment | C99 | Digraphs | HexFloat | OpenCL)
LANGSTANDARD_ALIAS_DEPR(opencl10, "cl")

LANGSTANDARD(opencl11, "cl1.1",
             OpenCL, "OpenCL 1.1",
             LineComment | C99 | Digraphs | HexFloat | OpenCL)
LANGSTANDARD(opencl12, "cl1.2",
             OpenCL, "OpenCL 1.2",
             LineComment | C99 | Digraphs | HexFloat | OpenCL)
LANGSTANDARD(opencl20, "cl2.0",
             OpenCL, "OpenCL 2.0",
             LineComment | C99 | Digraphs | HexFloat | OpenCL)
LANGSTANDARD(openclcpp, "clc++",
             OpenCL, "C++ for OpenCL",
             LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
             Digraphs | HexFloat | OpenCL)

LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")

// CUDA
LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)",
             LineComment | CPlusPlus | Digraphs)

// HIP
LANGSTANDARD(hip, "hip", HIP, "HIP",
             LineComment | CPlusPlus | Digraphs)

#undef LANGSTANDARD
#undef LANGSTANDARD_ALIAS
#undef LANGSTANDARD_ALIAS_DEPR