1010#error "LANGSTANDARD must be defined before including this file"
1111#endif
1212
13- // / LANGSTANDARD(IDENT, NAME, LANG, DESC, FEATURES)
13+ // / LANGSTANDARD(IDENT, NAME, LANG, DESC, FEATURES, VERSION )
1414// /
1515// / \param IDENT - The name of the standard as a C++ identifier.
1616// / \param NAME - The name of the standard.
1717// / \param LANG - The Language for which this is a standard.
1818// / \param DESC - A short description of the standard.
1919// / \param FEATURES - The standard features as flags, these are enums from the
2020// / clang::frontend namespace, which is assumed to be available.
21+ // / \param VERSION - The official version code for this standard.
22+ // / Has value 'std::nullopt' if no official version exists.
2123
2224// / LANGSTANDARD_ALIAS(IDENT, ALIAS)
2325// / \param IDENT - The name of the standard as a C++ identifier.
3638
3739// C89-ish modes.
3840LANGSTANDARD (c89, " c89" ,
39- C, " ISO C 1990" , 0 )
41+ C, " ISO C 1990" , 0 , std:: nullopt )
4042LANGSTANDARD_ALIAS(c89, " c90" )
4143LANGSTANDARD_ALIAS(c89, " iso9899:1990" )
4244
4345LANGSTANDARD(c94, " iso9899:199409" ,
4446 C, " ISO C 1990 with amendment 1" ,
45- Digraphs)
47+ Digraphs, 199409 )
4648
4749LANGSTANDARD(gnu89, " gnu89" ,
4850 C, " ISO C 1990 with GNU extensions" ,
49- LineComment | Digraphs | GNUMode)
51+ LineComment | Digraphs | GNUMode, std:: nullopt )
5052LANGSTANDARD_ALIAS(gnu89, " gnu90" )
5153
5254// C99-ish modes
5355LANGSTANDARD(c99, " c99" ,
5456 C, " ISO C 1999" ,
55- LineComment | C99 | Digraphs | HexFloat)
57+ LineComment | C99 | Digraphs | HexFloat, 199901 )
5658LANGSTANDARD_ALIAS(c99, " iso9899:1999" )
5759LANGSTANDARD_ALIAS_DEPR(c99, " c9x" )
5860LANGSTANDARD_ALIAS_DEPR(c99, " iso9899:199x" )
5961
6062LANGSTANDARD(gnu99, " gnu99" ,
6163 C, " ISO C 1999 with GNU extensions" ,
62- LineComment | C99 | Digraphs | GNUMode | HexFloat)
64+ LineComment | C99 | Digraphs | GNUMode | HexFloat, 199901 )
6365LANGSTANDARD_ALIAS_DEPR(gnu99, " gnu9x" )
6466
6567// C11 modes
6668LANGSTANDARD(c11, " c11" ,
6769 C, " ISO C 2011" ,
68- LineComment | C99 | C11 | Digraphs | HexFloat)
70+ LineComment | C99 | C11 | Digraphs | HexFloat, 201112 )
6971LANGSTANDARD_ALIAS(c11, " iso9899:2011" )
7072LANGSTANDARD_ALIAS_DEPR(c11, " c1x" )
7173LANGSTANDARD_ALIAS_DEPR(c11, " iso9899:201x" )
7274
7375LANGSTANDARD(gnu11, " gnu11" ,
7476 C, " ISO C 2011 with GNU extensions" ,
75- LineComment | C99 | C11 | Digraphs | GNUMode | HexFloat)
77+ LineComment | C99 | C11 | Digraphs | GNUMode | HexFloat, 201112 )
7678LANGSTANDARD_ALIAS_DEPR(gnu11, " gnu1x" )
7779
7880// C17 modes
7981LANGSTANDARD(c17, " c17" ,
8082 C, " ISO C 2017" ,
81- LineComment | C99 | C11 | C17 | Digraphs | HexFloat)
83+ LineComment | C99 | C11 | C17 | Digraphs | HexFloat, 201710 )
8284LANGSTANDARD_ALIAS(c17, " iso9899:2017" )
8385LANGSTANDARD_ALIAS(c17, " c18" )
8486LANGSTANDARD_ALIAS(c17, " iso9899:2018" )
8587LANGSTANDARD(gnu17, " gnu17" ,
8688 C, " ISO C 2017 with GNU extensions" ,
87- LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat)
89+ LineComment | C99 | C11 | C17 | Digraphs | GNUMode | HexFloat, 201710 )
8890LANGSTANDARD_ALIAS(gnu17, " gnu18" )
8991
9092// C23 modes
9193LANGSTANDARD(c23, " c23" ,
9294 C, " ISO C 2023" ,
93- LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat)
95+ LineComment | C99 | C11 | C17 | C23 | Digraphs | HexFloat, 202311 )
9496LANGSTANDARD_ALIAS(c23, " iso9899:2024" )
9597LANGSTANDARD_ALIAS_DEPR(c23, " c2x" )
9698LANGSTANDARD(gnu23, " gnu23" ,
9799 C, " ISO C 2023 with GNU extensions" ,
98- LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat)
100+ LineComment | C99 | C11 | C17 | C23 | Digraphs | GNUMode | HexFloat, 202311 )
99101LANGSTANDARD_ALIAS_DEPR(gnu23, " gnu2x" )
100102
101103// C2y modes
104+ // FIXME: Use correct version code for C2y once published.
102105LANGSTANDARD(c2y, " c2y" ,
103106 C, " Working Draft for ISO C2y" ,
104- LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | HexFloat)
107+ LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | HexFloat, 202400 )
105108LANGSTANDARD(gnu2y, " gnu2y" ,
106109 C, " Working Draft for ISO C2y with GNU extensions" ,
107- LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | GNUMode | HexFloat)
110+ LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | GNUMode | HexFloat, 202400 )
108111// TODO: Add the iso9899:202y alias once ISO publishes the standard.
109112
110113// C++ modes
111114LANGSTANDARD(cxx98, " c++98" ,
112115 CXX, " ISO C++ 1998 with amendments" ,
113- LineComment | CPlusPlus | Digraphs)
116+ LineComment | CPlusPlus | Digraphs, 199711 )
114117LANGSTANDARD_ALIAS(cxx98, " c++03" )
115118
116119LANGSTANDARD(gnucxx98, " gnu++98" ,
117120 CXX, " ISO C++ 1998 with amendments and GNU extensions" ,
118- LineComment | CPlusPlus | Digraphs | GNUMode)
121+ LineComment | CPlusPlus | Digraphs | GNUMode, 199711 )
119122LANGSTANDARD_ALIAS(gnucxx98, " gnu++03" )
120123
121124LANGSTANDARD(cxx11, " c++11" ,
122125 CXX, " ISO C++ 2011 with amendments" ,
123- LineComment | CPlusPlus | CPlusPlus11 | Digraphs)
126+ LineComment | CPlusPlus | CPlusPlus11 | Digraphs, 201103 )
124127LANGSTANDARD_ALIAS_DEPR(cxx11, " c++0x" )
125128
126129LANGSTANDARD(gnucxx11, " gnu++11" , CXX,
127130 " ISO C++ 2011 with amendments and GNU extensions" ,
128- LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode)
131+ LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode, 201103 )
129132LANGSTANDARD_ALIAS_DEPR(gnucxx11, " gnu++0x" )
130133
131134LANGSTANDARD(cxx14, " c++14" ,
132135 CXX, " ISO C++ 2014 with amendments" ,
133- LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs)
136+ LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs, 201402 )
134137LANGSTANDARD_ALIAS_DEPR(cxx14, " c++1y" )
135138
136139LANGSTANDARD(gnucxx14, " gnu++14" ,
137140 CXX, " ISO C++ 2014 with amendments and GNU extensions" ,
138141 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs |
139- GNUMode)
142+ GNUMode, 201402 )
140143LANGSTANDARD_ALIAS_DEPR(gnucxx14, " gnu++1y" )
141144
142145LANGSTANDARD(cxx17, " c++17" ,
143146 CXX, " ISO C++ 2017 with amendments" ,
144147 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
145- Digraphs | HexFloat)
148+ Digraphs | HexFloat, 201703 )
146149LANGSTANDARD_ALIAS_DEPR(cxx17, " c++1z" )
147150
148151LANGSTANDARD(gnucxx17, " gnu++17" ,
149152 CXX, " ISO C++ 2017 with amendments and GNU extensions" ,
150153 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
151- Digraphs | HexFloat | GNUMode)
154+ Digraphs | HexFloat | GNUMode, 201703 )
152155LANGSTANDARD_ALIAS_DEPR(gnucxx17, " gnu++1z" )
153156
154157LANGSTANDARD(cxx20, " c++20" ,
155158 CXX, " ISO C++ 2020 DIS" ,
156159 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
157- CPlusPlus20 | Digraphs | HexFloat)
160+ CPlusPlus20 | Digraphs | HexFloat, 202002 )
158161LANGSTANDARD_ALIAS_DEPR(cxx20, " c++2a" )
159162
160163LANGSTANDARD(gnucxx20, " gnu++20" ,
161164 CXX, " ISO C++ 2020 DIS with GNU extensions" ,
162165 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
163- CPlusPlus20 | Digraphs | HexFloat | GNUMode)
166+ CPlusPlus20 | Digraphs | HexFloat | GNUMode, 202002 )
164167LANGSTANDARD_ALIAS_DEPR(gnucxx20, " gnu++2a" )
165168
166169LANGSTANDARD(cxx23, " c++23" ,
167170 CXX, " ISO C++ 2023 DIS" ,
168171 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
169- CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat)
172+ CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat, 202302 )
170173LANGSTANDARD_ALIAS_DEPR(cxx23, " c++2b" )
171174
172175LANGSTANDARD(gnucxx23, " gnu++23" ,
173176 CXX, " ISO C++ 2023 DIS with GNU extensions" ,
174177 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
175- CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat | GNUMode)
178+ CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat | GNUMode, 202302 )
176179LANGSTANDARD_ALIAS_DEPR(gnucxx23, " gnu++2b" )
177180
181+ // FIXME: Use correct version code for C++26 once published.
178182LANGSTANDARD(cxx26, " c++2c" ,
179183 CXX, " Working draft for C++2c" ,
180184 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
181- CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat)
185+ CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat, 202400 )
182186LANGSTANDARD_ALIAS(cxx26, " c++26" )
183187
184188LANGSTANDARD(gnucxx26, " gnu++2c" ,
185189 CXX, " Working draft for C++2c with GNU extensions" ,
186190 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
187- CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat | GNUMode)
191+ CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat | GNUMode, 202400 )
188192LANGSTANDARD_ALIAS(gnucxx26, " gnu++26" )
189193
190194// OpenCL
191195LANGSTANDARD(opencl10, " cl1.0" ,
192196 OpenCL, " OpenCL 1.0" ,
193- LineComment | C99 | Digraphs | HexFloat | OpenCL)
197+ LineComment | C99 | Digraphs | HexFloat | OpenCL, std:: nullopt )
194198LANGSTANDARD_ALIAS_DEPR(opencl10, " cl" )
195199
196200LANGSTANDARD(opencl11, " cl1.1" ,
197201 OpenCL, " OpenCL 1.1" ,
198- LineComment | C99 | Digraphs | HexFloat | OpenCL)
202+ LineComment | C99 | Digraphs | HexFloat | OpenCL, std:: nullopt )
199203LANGSTANDARD(opencl12, " cl1.2" ,
200204 OpenCL, " OpenCL 1.2" ,
201- LineComment | C99 | Digraphs | HexFloat | OpenCL)
205+ LineComment | C99 | Digraphs | HexFloat | OpenCL, std:: nullopt )
202206LANGSTANDARD(opencl20, " cl2.0" ,
203207 OpenCL, " OpenCL 2.0" ,
204- LineComment | C99 | Digraphs | HexFloat | OpenCL)
208+ LineComment | C99 | Digraphs | HexFloat | OpenCL, std:: nullopt )
205209LANGSTANDARD(opencl30, " cl3.0" ,
206210 OpenCL, " OpenCL 3.0" ,
207- LineComment | C99 | Digraphs | HexFloat | OpenCL)
211+ LineComment | C99 | Digraphs | HexFloat | OpenCL, std:: nullopt )
208212
209213LANGSTANDARD(openclcpp10, " clc++1.0" ,
210214 OpenCL, " C++ for OpenCL 1.0" ,
211215 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
212- Digraphs | HexFloat | OpenCL)
216+ Digraphs | HexFloat | OpenCL, std:: nullopt )
213217LANGSTANDARD_ALIAS(openclcpp10, " clc++" )
214218
215219LANGSTANDARD(openclcpp2021, " clc++2021" ,
216220 OpenCL, " C++ for OpenCL 2021" ,
217221 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
218- Digraphs | HexFloat | OpenCL)
222+ Digraphs | HexFloat | OpenCL, std:: nullopt )
219223
220224LANGSTANDARD_ALIAS_DEPR(opencl10, " CL" )
221225LANGSTANDARD_ALIAS_DEPR(opencl11, " CL1.1" )
@@ -229,35 +233,35 @@ LANGSTANDARD_ALIAS_DEPR(openclcpp2021, "CLC++2021")
229233// HLSL
230234LANGSTANDARD(hlsl, " hlsl" ,
231235 HLSL, " High Level Shader Language" ,
232- LineComment | HLSL | CPlusPlus | CPlusPlus11)
236+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
233237
234238LANGSTANDARD(hlsl2015, " hlsl2015" ,
235239 HLSL, " High Level Shader Language 2015" ,
236- LineComment | HLSL | CPlusPlus | CPlusPlus11)
240+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
237241
238242LANGSTANDARD(hlsl2016, " hlsl2016" ,
239243 HLSL, " High Level Shader Language 2016" ,
240- LineComment | HLSL | CPlusPlus | CPlusPlus11)
244+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
241245
242246LANGSTANDARD(hlsl2017, " hlsl2017" ,
243247 HLSL, " High Level Shader Language 2017" ,
244- LineComment | HLSL | CPlusPlus | CPlusPlus11)
248+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
245249
246250LANGSTANDARD(hlsl2018, " hlsl2018" ,
247251 HLSL, " High Level Shader Language 2018" ,
248- LineComment | HLSL | CPlusPlus | CPlusPlus11)
252+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
249253
250254LANGSTANDARD(hlsl2021, " hlsl2021" ,
251255 HLSL, " High Level Shader Language 2021" ,
252- LineComment | HLSL | CPlusPlus | CPlusPlus11)
256+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
253257
254258LANGSTANDARD(hlsl202x, " hlsl202x" ,
255259 HLSL, " High Level Shader Language 202x" ,
256- LineComment | HLSL | CPlusPlus | CPlusPlus11)
260+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
257261
258262LANGSTANDARD(hlsl202y, " hlsl202y" ,
259263 HLSL, " High Level Shader Language 202y" ,
260- LineComment | HLSL | CPlusPlus | CPlusPlus11)
264+ LineComment | HLSL | CPlusPlus | CPlusPlus11, std:: nullopt )
261265
262266
263267#undef LANGSTANDARD
0 commit comments