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 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(cxx20, "c++20",
144 CXX, "ISO C++ 2020 DIS",
145 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
146 CPlusPlus2a | Digraphs | HexFloat)
147 LANGSTANDARD_ALIAS_DEPR(cxx20, "c++2a")
149 LANGSTANDARD(gnucxx20, "gnu++20",
150 CXX, "ISO C++ 2020 DIS with GNU extensions",
151 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
152 CPlusPlus2a | Digraphs | HexFloat | GNUMode)
153 LANGSTANDARD_ALIAS_DEPR(gnucxx20, "gnu++2a")
156 LANGSTANDARD(opencl10, "cl1.0",
157 OpenCL, "OpenCL 1.0",
158 LineComment | C99 | Digraphs | HexFloat | OpenCL)
159 LANGSTANDARD_ALIAS_DEPR(opencl10, "cl")
161 LANGSTANDARD(opencl11, "cl1.1",
162 OpenCL, "OpenCL 1.1",
163 LineComment | C99 | Digraphs | HexFloat | OpenCL)
164 LANGSTANDARD(opencl12, "cl1.2",
165 OpenCL, "OpenCL 1.2",
166 LineComment | C99 | Digraphs | HexFloat | OpenCL)
167 LANGSTANDARD(opencl20, "cl2.0",
168 OpenCL, "OpenCL 2.0",
169 LineComment | C99 | Digraphs | HexFloat | OpenCL)
170 LANGSTANDARD(openclcpp, "clc++",
171 OpenCL, "C++ for OpenCL",
172 LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 |
173 Digraphs | HexFloat | OpenCL)
175 LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
176 LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
177 LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
178 LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
179 LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")
182 LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)",
183 LineComment | CPlusPlus | Digraphs)
186 LANGSTANDARD(hip, "hip", HIP, "HIP",
187 LineComment | CPlusPlus | Digraphs)
190 #undef LANGSTANDARD_ALIAS
191 #undef LANGSTANDARD_ALIAS_DEPR