1//===-- LangStandards.def - Language Standard Data --------------*- C++ -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LANGSTANDARD
10#error "LANGSTANDARD must be defined before including this file"
11#endif
12
13/// LANGSTANDARD(IDENT, NAME, LANG, DESC, FEATURES)
14///
15/// \param IDENT - The name of the standard as a C++ identifier.
16/// \param NAME - The name of the standard.
17/// \param LANG - The 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 available.
21
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.
25
26/// LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS)
27/// Same as LANGSTANDARD_ALIAS, but for a deprecated alias.
28
29#ifndef LANGSTANDARD_ALIAS
30#define LANGSTANDARD_ALIAS(IDENT, ALIAS)
31#endif
32
33#ifndef LANGSTANDARD_ALIAS_DEPR
34#define LANGSTANDARD_ALIAS_DEPR(IDENT, ALIAS) LANGSTANDARD_ALIAS(IDENT, ALIAS)
35#endif
36
37// C89-ish modes.
38LANGSTANDARD(c89, "c89",
39 C, "ISO C 1990", 0)
40LANGSTANDARD_ALIAS(c89, "c90")
41LANGSTANDARD_ALIAS(c89, "iso9899:1990")
42
43LANGSTANDARD(c94, "iso9899:199409",
44 C, "ISO C 1990 with amendment 1",
45 Digraphs)
46
47LANGSTANDARD(gnu89, "gnu89",
48 C, "ISO C 1990 with GNU extensions",
49 LineComment | Digraphs | GNUMode)
50LANGSTANDARD_ALIAS(gnu89, "gnu90")
51
52// C99-ish modes
53LANGSTANDARD(c99, "c99",
54 C, "ISO C 1999",
55 LineComment | C99 | Digraphs | HexFloat)
56LANGSTANDARD_ALIAS(c99, "iso9899:1999")
57LANGSTANDARD_ALIAS_DEPR(c99, "c9x")
58LANGSTANDARD_ALIAS_DEPR(c99, "iso9899:199x")
59
60LANGSTANDARD(gnu99, "gnu99",
61 C, "ISO C 1999 with GNU extensions",
62 LineComment | C99 | Digraphs | GNUMode | HexFloat)
63LANGSTANDARD_ALIAS_DEPR(gnu99, "gnu9x")
64
65// C11 modes
66LANGSTANDARD(c11, "c11",
67 C, "ISO C 2011",
68 LineComment | C99 | C11 | Digraphs | HexFloat)
69LANGSTANDARD_ALIAS(c11, "iso9899:2011")
70LANGSTANDARD_ALIAS_DEPR(c11, "c1x")
71LANGSTANDARD_ALIAS_DEPR(c11, "iso9899:201x")
72
73LANGSTANDARD(gnu11, "gnu11",
74 C, "ISO C 2011 with GNU extensions",
75 LineComment | C99 | C11 | Digraphs | GNUMode | HexFloat)
76LANGSTANDARD_ALIAS_DEPR(gnu11, "gnu1x")
77
78// C17 modes
79LANGSTANDARD(c17, "c17",
80 C, "ISO C 2017",
81 LineComment | C99 | C11 | C17 | Digraphs | HexFloat)
82LANGSTANDARD_ALIAS(c17, "iso9899:2017")
83LANGSTANDARD_ALIAS(c17, "c18")
84LANGSTANDARD_ALIAS(c17, "iso9899:2018")
85LANGSTANDARD(gnu17, "gnu17",
86 C, "ISO C 2017 with GNU extensions",
87 LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat)
88LANGSTANDARD_ALIAS(gnu17, "gnu18")
89
90// C23 modes
91LANGSTANDARD(c23, "c23",
92 C, "Working Draft for ISO C23",
93 LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat)
94LANGSTANDARD_ALIAS_DEPR(c23, "c2x")
95LANGSTANDARD(gnu23, "gnu23",
96 C, "Working Draft for ISO C23 with GNU extensions",
97 LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat)
98LANGSTANDARD_ALIAS_DEPR(gnu23, "gnu2x")
99// FIXME: Add the alias for iso9899:202* once we know the year ISO publishes
100// the document (expected to be 2024).
101
102// C++ modes
103LANGSTANDARD(cxx98, "c++98",
104 CXX, "ISO C++ 1998 with amendments",
105 LineComment | CPlusPlus | Digraphs)
106LANGSTANDARD_ALIAS(cxx98, "c++03")
107
108LANGSTANDARD(gnucxx98, "gnu++98",
109 CXX, "ISO C++ 1998 with amendments and GNU extensions",
110 LineComment | CPlusPlus | Digraphs | GNUMode)
111LANGSTANDARD_ALIAS(gnucxx98, "gnu++03")
112
113LANGSTANDARD(cxx11, "c++11",
114 CXX, "ISO C++ 2011 with amendments",
115 LineComment | CPlusPlus | CPlusPlus11 | Digraphs)
116LANGSTANDARD_ALIAS_DEPR(cxx11, "c++0x")
117
118LANGSTANDARD(gnucxx11, "gnu++11", CXX,
119 "ISO C++ 2011 with amendments and GNU extensions",
120 LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode)
121LANGSTANDARD_ALIAS_DEPR(gnucxx11, "gnu++0x")
122
123LANGSTANDARD(cxx14, "c++14",
124 CXX, "ISO C++ 2014 with amendments",
125 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs)
126LANGSTANDARD_ALIAS_DEPR(cxx14, "c++1y")
127
128LANGSTANDARD(gnucxx14, "gnu++14",
129 CXX, "ISO C++ 2014 with amendments and GNU extensions",
130 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs |
131 GNUMode)
132LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y")
133
134LANGSTANDARD(cxx17, "c++17",
135 CXX, "ISO C++ 2017 with amendments",
136 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
137 Digraphs | HexFloat)
138LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z")
139
140LANGSTANDARD(gnucxx17, "gnu++17",
141 CXX, "ISO C++ 2017 with amendments and GNU extensions",
142 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
143 Digraphs | HexFloat | GNUMode)
144LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z")
145
146LANGSTANDARD(cxx20, "c++20",
147 CXX, "ISO C++ 2020 DIS",
148 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
149 CPlusPlus20 | Digraphs | HexFloat)
150LANGSTANDARD_ALIAS_DEPR(cxx20, "c++2a")
151
152LANGSTANDARD(gnucxx20, "gnu++20",
153 CXX, "ISO C++ 2020 DIS with GNU extensions",
154 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
155 CPlusPlus20 | Digraphs | HexFloat | GNUMode)
156LANGSTANDARD_ALIAS_DEPR(gnucxx20, "gnu++2a")
157
158LANGSTANDARD(cxx23, "c++23",
159 CXX, "ISO C++ 2023 DIS",
160 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
161 CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat)
162LANGSTANDARD_ALIAS_DEPR(cxx23, "c++2b")
163
164LANGSTANDARD(gnucxx23, "gnu++23",
165 CXX, "ISO C++ 2023 DIS with GNU extensions",
166 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
167 CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat | GNUMode)
168LANGSTANDARD_ALIAS_DEPR(gnucxx23, "gnu++2b")
169
170LANGSTANDARD(cxx26, "c++2c",
171 CXX, "Working draft for C++2c",
172 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
173 CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat)
174LANGSTANDARD_ALIAS(cxx26, "c++26")
175
176LANGSTANDARD(gnucxx26, "gnu++2c",
177 CXX, "Working draft for C++2c with GNU extensions",
178 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
179 CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat | GNUMode)
180LANGSTANDARD_ALIAS(gnucxx26, "gnu++26")
181
182// OpenCL
183LANGSTANDARD(opencl10, "cl1.0",
184 OpenCL, "OpenCL 1.0",
185 LineComment | C99 | Digraphs | HexFloat | OpenCL)
186LANGSTANDARD_ALIAS_DEPR(opencl10, "cl")
187
188LANGSTANDARD(opencl11, "cl1.1",
189 OpenCL, "OpenCL 1.1",
190 LineComment | C99 | Digraphs | HexFloat | OpenCL)
191LANGSTANDARD(opencl12, "cl1.2",
192 OpenCL, "OpenCL 1.2",
193 LineComment | C99 | Digraphs | HexFloat | OpenCL)
194LANGSTANDARD(opencl20, "cl2.0",
195 OpenCL, "OpenCL 2.0",
196 LineComment | C99 | Digraphs | HexFloat | OpenCL)
197LANGSTANDARD(opencl30, "cl3.0",
198 OpenCL, "OpenCL 3.0",
199 LineComment | C99 | Digraphs | HexFloat | OpenCL)
200
201LANGSTANDARD(openclcpp10, "clc++1.0",
202 OpenCL, "C++ for OpenCL 1.0",
203 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
204 Digraphs | HexFloat | OpenCL)
205LANGSTANDARD_ALIAS(openclcpp10, "clc++")
206
207LANGSTANDARD(openclcpp2021, "clc++2021",
208 OpenCL, "C++ for OpenCL 2021",
209 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
210 Digraphs | HexFloat | OpenCL)
211
212LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
213LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
214LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
215LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
216LANGSTANDARD_ALIAS_DEPR(opencl30, "CL3.0")
217LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++")
218LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++1.0")
219LANGSTANDARD_ALIAS_DEPR(openclcpp2021, "CLC++2021")
220
221// HLSL
222LANGSTANDARD(hlsl, "hlsl",
223 HLSL, "High Level Shader Language",
224 LineComment | HLSL | CPlusPlus )
225
226LANGSTANDARD(hlsl2015, "hlsl2015",
227 HLSL, "High Level Shader Language 2015",
228 LineComment | HLSL | CPlusPlus )
229
230LANGSTANDARD(hlsl2016, "hlsl2016",
231 HLSL, "High Level Shader Language 2016",
232 LineComment | HLSL | CPlusPlus )
233
234LANGSTANDARD(hlsl2017, "hlsl2017",
235 HLSL, "High Level Shader Language 2017",
236 LineComment | HLSL | CPlusPlus )
237
238LANGSTANDARD(hlsl2018, "hlsl2018",
239 HLSL, "High Level Shader Language 2018",
240 LineComment | HLSL | CPlusPlus )
241
242LANGSTANDARD(hlsl2021, "hlsl2021",
243 HLSL, "High Level Shader Language 2021",
244 LineComment | HLSL | CPlusPlus )
245
246LANGSTANDARD(hlsl202x, "hlsl202x",
247 HLSL, "High Level Shader Language 202x",
248 LineComment | HLSL | CPlusPlus | CPlusPlus11)
249
250
251#undef LANGSTANDARD
252#undef LANGSTANDARD_ALIAS
253#undef LANGSTANDARD_ALIAS_DEPR
254

source code of clang/include/clang/Basic/LangStandards.def