1 //===-- LangStandards.def - Language Standard Data --------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 #error "LANGSTANDARD must be defined before including this file"
13 /// LANGSTANDARD(IDENT, NAME, LANG, DESC, FEATURES)
15 /// \param IDENT - The name of the standard as a C++ identifier.
16 /// \param NAME - The name of the standard.
17 /// \param LANG - The InputKind::Language for which this is a standard.
18 /// \param DESC - A short description of the standard.
19 /// \param FEATURES - The standard features as flags, these are enums from the
20 /// clang::frontend namespace, which is assumed to be be available.
22 /// LANGSTANDARD_ALIAS(IDENT, ALIAS)
23 /// \param IDENT - The name of the standard as a C++ identifier.
24 /// \param ALIAS - The alias of the standard.
26 /// LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS)
27 /// Same as LANGSTANDARD_ALIAS, but for a deprecated alias.
29 #ifndef LANGSTANDARD_ALIAS
30 #define LANGSTANDARD_ALIAS(IDENT, ALIAS)
33 #ifndef LANGSTANDARD_ALIAS_DEPR
34 #define LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS) LANGSTANDARD_ALIAS(IDENT, ALIAS)
38 LANGSTANDARD(c89, "c89",
41 LANGSTANDARD_ALIAS(c89, "c90")
42 LANGSTANDARD_ALIAS(c89, "iso9899:1990")
44 LANGSTANDARD(c94, "iso9899:199409",
45 C, "ISO C 1990 with amendment 1",
46 Digraphs | ImplicitInt)
48 LANGSTANDARD(gnu89, "gnu89",
49 C, "ISO C 1990 with GNU extensions",
50 LineComment | Digraphs | GNUMode | ImplicitInt)
51 LANGSTANDARD_ALIAS(gnu89, "gnu90")
54 LANGSTANDARD(c99, "c99",
56 LineComment | C99 | Digraphs | HexFloat)
57 LANGSTANDARD_ALIAS(c99, "iso9899:1999")
58 LANGSTANDARD_ALIAS_DEPR(c99, "c9x")
59 LANGSTANDARD_ALIAS_DEPR(c99, "iso9899:199x")
61 LANGSTANDARD(gnu99, "gnu99",
62 C, "ISO C 1999 with GNU extensions",
63 LineComment | C99 | Digraphs | GNUMode | HexFloat)
64 LANGSTANDARD_ALIAS_DEPR(gnu99, "gnu9x")
67 LANGSTANDARD(c11, "c11",
69 LineComment | C99 | C11 | Digraphs | HexFloat)
70 LANGSTANDARD_ALIAS(c11, "iso9899:2011")
71 LANGSTANDARD_ALIAS_DEPR(c11, "c1x")
72 LANGSTANDARD_ALIAS_DEPR(c11, "iso9899:201x")
74 LANGSTANDARD(gnu11, "gnu11",
75 C, "ISO C 2011 with GNU extensions",
76 LineComment | C99 | C11 | Digraphs | GNUMode | HexFloat)
77 LANGSTANDARD_ALIAS_DEPR(gnu11, "gnu1x")
80 LANGSTANDARD(c17, "c17",
82 LineComment | C99 | C11 | C17 | Digraphs | HexFloat)
83 LANGSTANDARD_ALIAS(c17, "iso9899:2017")
84 LANGSTANDARD_ALIAS(c17, "c18")
85 LANGSTANDARD_ALIAS(c17, "iso9899:2018")
86 LANGSTANDARD(gnu17, "gnu17",
87 C, "ISO C 2017 with GNU extensions",
88 LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat)
89 LANGSTANDARD_ALIAS(gnu17, "gnu18")
92 LANGSTANDARD(c2x, "c2x",
93 C, "Working Draft for ISO C2x",
94 LineComment | C99 | C11 | C17 | C2x | Digraphs | HexFloat)
95 LANGSTANDARD(gnu2x, "gnu2x",
96 C, "Working Draft for ISO C2x with GNU extensions",
97 LineComment | C99 | C11 | C17 | C2x | Digraphs | GNUMode | HexFloat)
100 LANGSTANDARD(cxx98, "c++98",
101 CXX, "ISO C++ 1998 with amendments",
102 LineComment | CPlusPlus | Digraphs)
103 LANGSTANDARD_ALIAS(cxx98, "c++03")
105 LANGSTANDARD(gnucxx98, "gnu++98",
106 CXX, "ISO C++ 1998 with amendments and GNU extensions",
107 LineComment | CPlusPlus | Digraphs | GNUMode)
108 LANGSTANDARD_ALIAS(gnucxx98, "gnu++03")
110 LANGSTANDARD(cxx11, "c++11",
111 CXX, "ISO C++ 2011 with amendments",
112 LineComment | CPlusPlus | CPlusPlus11 | Digraphs)
113 LANGSTANDARD_ALIAS_DEPR(cxx11, "c++0x")
115 LANGSTANDARD(gnucxx11, "gnu++11", CXX,
116 "ISO C++ 2011 with amendments and GNU extensions",
117 LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode)
118 LANGSTANDARD_ALIAS_DEPR(gnucxx11, "gnu++0x")
120 LANGSTANDARD(cxx14, "c++14",
121 CXX, "ISO C++ 2014 with amendments",
122 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs)
123 LANGSTANDARD_ALIAS_DEPR(cxx14, "c++1y")
125 LANGSTANDARD(gnucxx14, "gnu++14",
126 CXX, "ISO C++ 2014 with amendments and GNU extensions",
127 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs |
129 LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y")
131 LANGSTANDARD(cxx17, "c++17",
132 CXX, "ISO C++ 2017 with amendments",
133 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
135 LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z")
137 LANGSTANDARD(gnucxx17, "gnu++17",
138 CXX, "ISO C++ 2017 with amendments and GNU extensions",
139 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
140 Digraphs | HexFloat | GNUMode)
141 LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z")
143 LANGSTANDARD(cxx2a, "c++2a",
144 CXX, "Working draft for ISO C++ 2020",
145 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
146 CPlusPlus2a | Digraphs | HexFloat)
148 LANGSTANDARD(gnucxx2a, "gnu++2a",
149 CXX, "Working draft for ISO C++ 2020 with GNU extensions",
150 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
151 CPlusPlus2a | Digraphs | HexFloat | GNUMode)
154 LANGSTANDARD(opencl10, "cl1.0",
155 OpenCL, "OpenCL 1.0",
156 LineComment | C99 | Digraphs | HexFloat | OpenCL)
157 LANGSTANDARD_ALIAS_DEPR(opencl10, "cl")
159 LANGSTANDARD(opencl11, "cl1.1",
160 OpenCL, "OpenCL 1.1",
161 LineComment | C99 | Digraphs | HexFloat | OpenCL)
162 LANGSTANDARD(opencl12, "cl1.2",
163 OpenCL, "OpenCL 1.2",
164 LineComment | C99 | Digraphs | HexFloat | OpenCL)
165 LANGSTANDARD(opencl20, "cl2.0",
166 OpenCL, "OpenCL 2.0",
167 LineComment | C99 | Digraphs | HexFloat | OpenCL)
168 LANGSTANDARD(openclcpp, "clc++",
169 OpenCL, "C++ for OpenCL",
170 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
171 Digraphs | HexFloat | OpenCL)
173 LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
174 LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
175 LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
176 LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
177 LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")
180 LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)",
181 LineComment | CPlusPlus | Digraphs)
184 LANGSTANDARD(hip, "hip", HIP, "HIP",
185 LineComment | CPlusPlus | Digraphs)
188 #undef LANGSTANDARD_ALIAS
189 #undef LANGSTANDARD_ALIAS_DEPR