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// C2y modes 103LANGSTANDARD(c2y, "c2y", 104 C, "Working Draft for ISO C2y", 105 LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | HexFloat) 106LANGSTANDARD(gnu2y, "gnu2y", 107 C, "Working Draft for ISO C2y with GNU extensions", 108 LineComment | C99 | C11 | C17 | C23 | C2y | Digraphs | GNUMode | HexFloat) 109 110 111// C++ modes 112LANGSTANDARD(cxx98, "c++98", 113 CXX, "ISO C++ 1998 with amendments", 114 LineComment | CPlusPlus | Digraphs) 115LANGSTANDARD_ALIAS(cxx98, "c++03") 116 117LANGSTANDARD(gnucxx98, "gnu++98", 118 CXX, "ISO C++ 1998 with amendments and GNU extensions", 119 LineComment | CPlusPlus | Digraphs | GNUMode) 120LANGSTANDARD_ALIAS(gnucxx98, "gnu++03") 121 122LANGSTANDARD(cxx11, "c++11", 123 CXX, "ISO C++ 2011 with amendments", 124 LineComment | CPlusPlus | CPlusPlus11 | Digraphs) 125LANGSTANDARD_ALIAS_DEPR(cxx11, "c++0x") 126 127LANGSTANDARD(gnucxx11, "gnu++11", CXX, 128 "ISO C++ 2011 with amendments and GNU extensions", 129 LineComment | CPlusPlus | CPlusPlus11 | Digraphs | GNUMode) 130LANGSTANDARD_ALIAS_DEPR(gnucxx11, "gnu++0x") 131 132LANGSTANDARD(cxx14, "c++14", 133 CXX, "ISO C++ 2014 with amendments", 134 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs) 135LANGSTANDARD_ALIAS_DEPR(cxx14, "c++1y") 136 137LANGSTANDARD(gnucxx14, "gnu++14", 138 CXX, "ISO C++ 2014 with amendments and GNU extensions", 139 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs | 140 GNUMode) 141LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y") 142 143LANGSTANDARD(cxx17, "c++17", 144 CXX, "ISO C++ 2017 with amendments", 145 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 146 Digraphs | HexFloat) 147LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z") 148 149LANGSTANDARD(gnucxx17, "gnu++17", 150 CXX, "ISO C++ 2017 with amendments and GNU extensions", 151 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 152 Digraphs | HexFloat | GNUMode) 153LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z") 154 155LANGSTANDARD(cxx20, "c++20", 156 CXX, "ISO C++ 2020 DIS", 157 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 158 CPlusPlus20 | Digraphs | HexFloat) 159LANGSTANDARD_ALIAS_DEPR(cxx20, "c++2a") 160 161LANGSTANDARD(gnucxx20, "gnu++20", 162 CXX, "ISO C++ 2020 DIS with GNU extensions", 163 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 164 CPlusPlus20 | Digraphs | HexFloat | GNUMode) 165LANGSTANDARD_ALIAS_DEPR(gnucxx20, "gnu++2a") 166 167LANGSTANDARD(cxx23, "c++23", 168 CXX, "ISO C++ 2023 DIS", 169 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 170 CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat) 171LANGSTANDARD_ALIAS_DEPR(cxx23, "c++2b") 172 173LANGSTANDARD(gnucxx23, "gnu++23", 174 CXX, "ISO C++ 2023 DIS with GNU extensions", 175 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 176 CPlusPlus20 | CPlusPlus23 | Digraphs | HexFloat | GNUMode) 177LANGSTANDARD_ALIAS_DEPR(gnucxx23, "gnu++2b") 178 179LANGSTANDARD(cxx26, "c++2c", 180 CXX, "Working draft for C++2c", 181 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 182 CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat) 183LANGSTANDARD_ALIAS(cxx26, "c++26") 184 185LANGSTANDARD(gnucxx26, "gnu++2c", 186 CXX, "Working draft for C++2c with GNU extensions", 187 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 188 CPlusPlus20 | CPlusPlus23 | CPlusPlus26 | Digraphs | HexFloat | GNUMode) 189LANGSTANDARD_ALIAS(gnucxx26, "gnu++26") 190 191// OpenCL 192LANGSTANDARD(opencl10, "cl1.0", 193 OpenCL, "OpenCL 1.0", 194 LineComment | C99 | Digraphs | HexFloat | OpenCL) 195LANGSTANDARD_ALIAS_DEPR(opencl10, "cl") 196 197LANGSTANDARD(opencl11, "cl1.1", 198 OpenCL, "OpenCL 1.1", 199 LineComment | C99 | Digraphs | HexFloat | OpenCL) 200LANGSTANDARD(opencl12, "cl1.2", 201 OpenCL, "OpenCL 1.2", 202 LineComment | C99 | Digraphs | HexFloat | OpenCL) 203LANGSTANDARD(opencl20, "cl2.0", 204 OpenCL, "OpenCL 2.0", 205 LineComment | C99 | Digraphs | HexFloat | OpenCL) 206LANGSTANDARD(opencl30, "cl3.0", 207 OpenCL, "OpenCL 3.0", 208 LineComment | C99 | Digraphs | HexFloat | OpenCL) 209 210LANGSTANDARD(openclcpp10, "clc++1.0", 211 OpenCL, "C++ for OpenCL 1.0", 212 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 213 Digraphs | HexFloat | OpenCL) 214LANGSTANDARD_ALIAS(openclcpp10, "clc++") 215 216LANGSTANDARD(openclcpp2021, "clc++2021", 217 OpenCL, "C++ for OpenCL 2021", 218 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | 219 Digraphs | HexFloat | OpenCL) 220 221LANGSTANDARD_ALIAS_DEPR(opencl10, "CL") 222LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1") 223LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2") 224LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0") 225LANGSTANDARD_ALIAS_DEPR(opencl30, "CL3.0") 226LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++") 227LANGSTANDARD_ALIAS_DEPR(openclcpp10, "CLC++1.0") 228LANGSTANDARD_ALIAS_DEPR(openclcpp2021, "CLC++2021") 229 230// HLSL 231LANGSTANDARD(hlsl, "hlsl", 232 HLSL, "High Level Shader Language", 233 LineComment | HLSL | CPlusPlus ) 234 235LANGSTANDARD(hlsl2015, "hlsl2015", 236 HLSL, "High Level Shader Language 2015", 237 LineComment | HLSL | CPlusPlus ) 238 239LANGSTANDARD(hlsl2016, "hlsl2016", 240 HLSL, "High Level Shader Language 2016", 241 LineComment | HLSL | CPlusPlus ) 242 243LANGSTANDARD(hlsl2017, "hlsl2017", 244 HLSL, "High Level Shader Language 2017", 245 LineComment | HLSL | CPlusPlus ) 246 247LANGSTANDARD(hlsl2018, "hlsl2018", 248 HLSL, "High Level Shader Language 2018", 249 LineComment | HLSL | CPlusPlus ) 250 251LANGSTANDARD(hlsl2021, "hlsl2021", 252 HLSL, "High Level Shader Language 2021", 253 LineComment | HLSL | CPlusPlus ) 254 255LANGSTANDARD(hlsl202x, "hlsl202x", 256 HLSL, "High Level Shader Language 202x", 257 LineComment | HLSL | CPlusPlus | CPlusPlus11) 258 259 260#undef LANGSTANDARD 261#undef LANGSTANDARD_ALIAS 262#undef LANGSTANDARD_ALIAS_DEPR 263