From b9c0e590f1fd4ea37da5c2b9b78d8e715c885f56 Mon Sep 17 00:00:00 2001
From: Corentin Jabot Clang implements the following published and upcoming ISO C++ standards:
+
@@ -85,513 +85,735 @@ language.
+
+ Language Standard
+ Flag
+ Available in Clang?
+
+
C++2c
+ -std=c++2c
+ Partial
+
-
-Language Standard
- Flag
- Available in Clang?
-
-
-C++98 / C++03
- -std=c++98
- Yes (other than export)
-
-
-C++11
- -std=c++11
- Clang 3.3
-
-
-C++14
- -std=c++14
- Clang 3.4
-
-
-C++17
- -std=c++17
- Clang 5
-
-
-C++20
- -std=c++20
- Partial
-
-
-C++23
- -std=c++23
- Partial
-
-
+ C++2c
- -std=c++2c
- Partial
+ C++23
+ -std=c++23
+ Partial
+
+
+ C++20
+ -std=c++20
+ Partial
+
+
+ C++17
+ -std=c++17
+ Clang 5
+
+
+ C++14
+ -std=c++14
+ Clang 3.4
+
+
+ C++11
+ -std=c++11
+ Clang 3.3
+
+
C++98 / C++03
+ -std=c++98
+ Yes (other than export)
Clang implements all of the ISO C++ 1998 standard - (including the defects addressed in the ISO C++ 2003 standard) - except for export (which was removed in C++11). + +
Clang has support for some of the features of the C++ standard following +C++23, informally referred to as C++26.
-You can use Clang in C++2c mode with the -std=c++2c
option.
Clang 3.3 and later implement all of the ISO - C++ 2011 standard.
+Language Feature | +C++26 Proposal | +Available in Clang? | +
---|
You can use Clang in C++11 mode with the -std=c++11
-option. Clang's C++11 mode can be used with
-libc++ or with gcc's libstdc++.
Clang has support for some of the features of the ISO C++ 2023 standard.
+ +You can use Clang in C++23 mode with the -std=c++23
option.
Language Feature | -C++11 Proposal | +C++23 Proposal | Available in Clang? | ||
---|---|---|---|---|---|
Rvalue references | -N2118 | -Clang 2.9 | -|||
P1825R0 (DR) | -Clang 13 | -||||
Rvalue references for *this |
- N2439 | -Clang 2.9 | +Literal suffix uz, z for size_t, ssize_t | +P0330R8 | +Clang 13 |
Initialization of class objects by rvalues | -N1610 | -Clang 2.9 | +Make () in lambdas optional in all cases | +P1102R2 | +Clang 13 |
Non-static data member initializers | -N2756 | -Clang 3.0 | +Simpler implicit move | +P2266R1 | +Clang 13 |
Variadic templates | -N2242 | -Clang 2.9 | +if consteval | +P1938R3 | +Clang 14 |
Extending variadic template template parameters | -N2555 | -Clang 2.9 | +Allow duplicate attributes | +P2156R1 | +Clang 13 |
Initializer lists | -N2672 | -Clang 3.1 | +Narrowing contextual conversions to bool | +P1401R5 | +Clang 14 |
P1009R2 (DR) | -Clang 9 | -||||
P1957R2 (DR) | -Clang 11 | -||||
Static assertions | -N1720 | -Clang 2.9 | +Trimming whitespaces before line splicing | +P2223R2 | +Yes |
auto -typed variables |
- N1984 | -Clang 2.9 | +Make declaration order layout mandated | +P1874R4 | +Yes |
Multi-declarator auto |
- N1737 | -Clang 2.9 | +C++ identifier syntax using UAX 31 | +P1949R7 | +Clang 14 |
Removal of auto as a storage-class specifier | -N2546 | -Clang 2.9 | +Mixed string literal concatenation | +P2201R1 | +Yes |
New function declarator syntax | -N2541 | -Clang 2.9 | +Deducing this | +P0847R7 | +No |
Lambda expressions | -N2927 | -Clang 3.1 | +P2797R0 | +No | |
P0588R1 (DR) | -No | -||||
Declared type of an expression | -N2343 | -Clang 2.9 | +Change scope of lambda trailing-return-type | +P2036R3 | +Clang 17 |
Incomplete return types | -N3276 | -Clang 3.1 | +P2579R0 | ||
Right angle brackets | -N1757 | -Clang 2.9 | +Multidimensional subscript operator | +P2128R6 | +Clang 15 |
Default template arguments for function templates | -DR226 | -Clang 2.9 | +Non-literal variables (and labels and gotos) in constexpr functions | +P2242R3 | +Clang 15 |
Solving the SFINAE problem for expressions | -DR339 | -Clang 2.9 | +Character encoding of diagnostic text | +P2246R1 | +Yes |
Alias templates | -N2258 | -Clang 3.0 | +Character sets and encodings | +P2314R4 | +Yes |
Extern templates | -N1987 | -Clang 2.9 | +Consistent character literal encoding | +P2316R2 | +Yes |
Null pointer constant | -N2431 | -Clang 3.0 | +Add support for preprocessing directives elifdef and elifndef | +P2334R1 | +Clang 13 |
Strongly-typed enums | -N2347 | -Clang 2.9 | +Extend init-statement to allow alias-declaration | +P2360R0 | +Clang 14 |
Forward declarations for enums | -N2764
- DR1206 |
- Clang 3.1 | +auto(x): decay-copy in the language | +P0849R8 | +Clang 15 |
Standardized attribute syntax | -N2761 | -Clang 3.3 (1) | +Attributes on Lambda-Expressions | +P2173R1 | +Clang 13 |
Generalized constant expressions | -N2235 | -Clang 3.1 | +constexpr for <cmath> and <cstdlib> | +P0533R9 | +No |
P0859R0 (DR) | -Clang 8 | -||||
Alignment support | -N2341 | -Clang 3.3 | +Type trait to determine if a reference binds to a temporary | +P2255R2 | +
+ Partial+ Clang provides a __reference_binds_to_temporary type trait + builtin, with which the library facility can be partially implemented. + Both __reference_constructs_from_temporary and + __reference_converts_from_temporary builtins should be + provided, following the normal cross-vendor convention to implement + traits requiring compiler support directly. + |
+
Conditionally-support behavior | -N1627 | -Clang 2.9 | -|||
Changing undefined behavior into diagnosable errors | -N1727 | -Clang 2.9 | +The Equality Operator You Are Looking For | +P2468R2 | +Clang 16 |
Delegating constructors | -N1986 | -Clang 3.0 | +De-deprecating volatile compound operations | +P2327R1 | +Clang 15 |
Inheriting constructors | -N2540 | -Clang 3.3 | +Support for #warning |
+ P2437R1 | +Yes |
P0136R1 (DR) | -Clang 3.9 | -||||
Explicit conversion operators | -N2437 | -Clang 3.0 | +Remove non-encodable wide character literals and multicharacter wide character literals | +P2362R3 | +Clang 14 |
New character types | -N2249 | -Clang 2.9 | +Labels at the end of compound statements | +P2324R2 | +Clang 16 |
Unicode string literals | -N2442 | -Clang 3.0 | +Delimited escape sequences | +P2290R3 | +Clang 15 |
Raw string literals | -N2442 | -Clang 3.0 | +Named universal character escapes | +P2071R2 | +Clang 15 |
Universal character names in literals | -N2170 | -Clang 3.1 | +Relaxing some constexpr restrictions | +P2448R2 | +
+ Clang 17 (Partial)+ We do not support outside of defaulted special memeber functions the change that constexpr functions no + longer have to be constexpr compatible but rather support a less restricted requirements for constexpr + functions. Which include allowing non-literal types as return values and parameters, allow calling of + non-constexpr functions and constructors. + |
+
User-defined literals | -N2765 | -Clang 3.1 | +Using unknown pointers and references in constant expressions | +P2280R4 | +No |
Standard Layout Types | -N2342 | -Clang 3.0 | +static operator() |
+ P1169R4 | +Clang 16 |
Defaulted functions | -N2346 | -Clang 3.0 | +Extended floating-point types and standard names | +P1467R9 | +No |
P1286R2 (DR) | -Clang 9 | -||||
Deleted functions | -N2346 | -Clang 2.9 | +Class template argument deduction from inherited constructors | +P2582R1 | +No |
Extended friend declarations | -N1791 | -Clang 2.9 | +Portable assumptions | +P1774R8 | +No |
Extending sizeof |
- N2253
- DR850 |
- Clang 3.1 | +Support for UTF-8 as a portable source file encoding | +P2295R6 | +Clang 15 |
Inline namespaces | -N2535 | -Clang 2.9 | +char8_t Compatibility and Portability Fix |
+ P2513R3 | +Clang 16 |
Unrestricted unions | -N2544 | -Clang 3.1 | +Relax requirements on wchar_t to match existing practices |
+ P2460R2 | +Yes |
Local and unnamed types as template arguments | -N2657 | -Clang 2.9 | +Explicit lifetime management | +P2590R2 | +No |
Range-based for | -N2930 | -Clang 3.0 | +static operator[] |
+ P2589R1 | +Clang 16 |
P0962R1 (DR) | -Clang 8 | -||||
Explicit virtual overrides | -N2928
- N3206 - N3272 |
- Clang 3.0 | +Permitting static constexpr variables in constexpr functions | +P2647R1 | +Clang 16 |
Minimal support for garbage collection and reachability-based leak detection | -N2670 | -N/A (2) | +consteval needs to propagate up | +P2564R3 (DR) | +No |
Allowing move constructors to throw [noexcept] | -N3050 | -Clang 3.0 | +Lifetime extension in range-based for loops | +P2718R0 | +No |
Defining move special member functions | -N3053 | -Clang 3.0 | +Referencing The Unicode Standard | +P2736R2 | +Yes |
Clang has support for some of the features of the +ISO C++ 2020 standard.
+ +You can use Clang in C++20 mode with the -std=c++20
option
+(use -std=c++2a
in Clang 9 and earlier).
Language Feature | +C++20 Proposal | +Available in Clang? | +|||
---|---|---|---|---|---|
Memory model | -N2429 | -Clang 3.2 | +Default member initializers for bit-fields | +P0683R1 | +Clang 6 |
Data-dependency ordering: atomics and memory model | -N2664 | -Clang 3.2 (4) | +const&-qualified pointers to members | +P0704R1 | +Clang 6 |
Propagating exceptions | -N2179 | -Clang 2.9 | +Allow lambda-capture [=, this] | +P0409R2 | +Clang 6 |
Allow atomics use in signal handlers | -N2547 | -Clang 3.1 | +__VA_OPT__ for preprocessor comma elision | +P0306R4 | +Clang 6 |
P1042R1 | +Clang 9 | +||||
Thread-local storage | -N2659 | -Clang 3.3 (5) | +Designated initializers | +P0329R4 | +Clang 10 |
Dynamic initialization and destruction with concurrency | -N2660 | -Clang 2.9 | -|||
C99 Features in C++11 | +template-parameter-list for generic lambdas | +P0428R2 | +Clang 9 | ||
__func__ predefined identifier |
- N2340 | -Clang 2.9 | +|||
Concepts | +P0734R0 | +Clang 10 | |||
P0857R0 | +Clang 16 | +||||
P1084R2 | +Clang 10 | +||||
P1141R2 | +|||||
P0848R3 | +
+
+
+ Clang 16 (Partial)+ Because of other concepts implementation deficits, the __cpp_concepts macro is not yet set to 202002L. + Also, the related defect reports DR1496 and + DR1734 are not yet implemented. Accordingly, deleted + special member functions are treated as eligible even though they shouldn't be. + |
+ ||||
P1616R1 | +Clang 10 | +||||
P1452R2 | +|||||
P1972R0 | +Clang 10 | +||||
P1980R0 | +|||||
P2103R0 | +|||||
P2493R0 | +|||||
P2092R0 | +Clang 16 | +||||
P2113R0 | +Clang 16 | +||||
C99 preprocessor | -N1653 | -Clang 2.9 | +Range-based for statements with initializer | +P0614R1 | +Clang 8 |
long long |
- N1811 | -Clang 2.9 | +ADL and function templates that are not visible | +P0846R0 | +Clang 9 |
Extended integral types | -N1988 | -N/A (6) | +const mismatch with defaulted copy constructor | +P0641R2 | +Clang 8 |
-(1): The [[carries_dependency]]
attribute
-has no effect.
-(2): No compiler changes are required for an implementation
-such as Clang that does not provide garbage collection.
-(3): All compare-exchange operations are emitted as
-strong compare-exchanges.
-(4): memory_order_consume
is lowered to
-memory_order_acquire
.
-(5): thread_local
support
-requires a C++ runtime library providing __cxa_thread_atexit
, such
-as libc++abi 3.6 or later,
-or libsupc++ 4.8 or later.
-(6): No compiler changes are required for an implementation
-such as Clang that does not provide any extended integer types.
-__int128
is not treated as an extended integer type,
-because changing intmax_t
would be an ABI-incompatible
-change.
-
Clang 3.4 and later implement all of the ISO - C++ 2014 standard.
- -You can use Clang in C++14 mode with the -std=c++14
option
-(use -std=c++1y
in Clang 3.4 and earlier).
Language Feature | -C++14 Proposal | -Available in Clang? | -|||
---|---|---|---|---|---|
Tweak to certain C++ contextual conversions | -N3323 | -Clang 3.4 | +Consistent comparison (operator<=>) | +P0515R3 | +Clang 10 |
P0905R1 | +|||||
P1120R0 | +|||||
P1185R2 | +|||||
P1186R3 | +|||||
P1630R1 | +|||||
P1946R0 | +|||||
P1959R0 | +|||||
P2002R1 | +Partial | +||||
P2085R0 | +Clang 14 | +||||
Binary literals | -N3472 | -Clang 2.9 | +Access checking on specializations | +P0692R1 | +Clang 14 |
decltype(auto) | -N3638 | -Clang 3.3 | +Default constructible and assignable stateless lambdas | +P0624R2 | +Clang 8 |
Return type deduction for normal functions | -Clang 3.4 | +Lambdas in unevaluated contexts | +P0315R4 | +Clang 17 | |
Initialized lambda captures | -N3648 | -Clang 3.4 | +[[no_unique_address]] attribute | +P0840R2 | +Clang 9 |
Generic lambdas | -N3649 | -Clang 3.4 | +[[likely]] and [[unlikely]] attributes | +P0479R5 | +Clang 12 |
Variable templates | -N3651 | -Clang 3.4 | +typename optional in more contexts | +P0634R3 | +Clang 16 |
Relaxing requirements on constexpr functions | -N3652 | -Clang 3.4 | +Pack expansion in lambda init-capture | +P0780R2 | +Clang 9 |
Member initializers and aggregates | -N3653 | -Clang 3.3 | +Class types as non-type template parameters | +P0732R2 | +Partial |
P1907R1 | +|||||
Clarifying memory allocation | -N3664 | -Clang 3.4 | +Destroying operator delete | +P0722R3 | +Clang 6 |
[[deprecated]] attribute | -N3760 | -Clang 3.4 | +Relaxations of constexpr restrictions | +P1064R0 | +Clang 9 |
P1002R1 | +Clang 8 | +||||
P1327R1 | +Clang 9 | +||||
P1330R0 | +|||||
P1331R2 | +Clang 10 | +||||
P1668R1 | +|||||
P0784R7 | +|||||
Single quotation mark as digit separator | -N3781 | -Clang 3.4 | +Prohibit aggregates with user-declared constructors | +P1008R1 | +Clang 8 |
C++ Sized Deallocation | -N3778 | -Clang 3.4 (7) | +Feature test macros | +P0941R2 | +(see below) |
-(7): In Clang 3.7 and later, sized deallocation is only enabled
-if the user passes the -fsized-deallocation
flag. The user must
-supply definitions of the sized deallocation functions, either by providing them
-explicitly or by using a C++ standard library that does. libstdc++
-added these functions in version 5.0, and libc++
added them in
-version 3.7.
-
-
+(11): Prior to Clang 8, this feature is not enabled by +-std=c++20, but can be enabled with -fchar8_t. + +
+Clang 5 and later implement all the features of the @@ -858,731 +1080,513 @@ code. This issue is expected to be rectified soon.
-Clang has support for some of the features of the -ISO C++ 2020 standard.
+Clang 3.4 and later implement all of the ISO + C++ 2014 standard.
-You can use Clang in C++20 mode with the -std=c++20
option
-(use -std=c++2a
in Clang 9 and earlier).
You can use Clang in C++14 mode with the -std=c++14
option
+(use -std=c++1y
in Clang 3.4 and earlier).
Language Feature | -C++20 Proposal | +C++14 Proposal | Available in Clang? | ||
---|---|---|---|---|---|
Default member initializers for bit-fields | -P0683R1 | -Clang 6 | +Tweak to certain C++ contextual conversions | +N3323 | +Clang 3.4 |
const&-qualified pointers to members | -P0704R1 | -Clang 6 | +Binary literals | +N3472 | +Clang 2.9 |
Allow lambda-capture [=, this] | -P0409R2 | -Clang 6 | +decltype(auto) | +N3638 | +Clang 3.3 |
__VA_OPT__ for preprocessor comma elision | -P0306R4 | -Clang 6 | +Return type deduction for normal functions | +Clang 3.4 | |
P1042R1 | -Clang 9 | -||||
Designated initializers | -P0329R4 | -Clang 10 | +Initialized lambda captures | +N3648 | +Clang 3.4 |
template-parameter-list for generic lambdas | -P0428R2 | -Clang 9 | +Generic lambdas | +N3649 | +Clang 3.4 |
Concepts | -P0734R0 | -Clang 10 | -|||
P0857R0 | -Clang 16 | -||||
P1084R2 | -Clang 10 | -||||
P1141R2 | -|||||
P0848R3 | -
-
-
- Clang 16 (Partial)- Because of other concepts implementation deficits, the __cpp_concepts macro is not yet set to 202002L. - Also, the related defect reports DR1496 and - DR1734 are not yet implemented. Accordingly, deleted - special member functions are treated as eligible even though they shouldn't be. - |
- ||||
P1616R1 | -Clang 10 | -||||
P1452R2 | -|||||
P1972R0 | -Clang 10 | -||||
P1980R0 | -|||||
P2103R0 | -|||||
P2493R0 | -|||||
P2092R0 | -Clang 16 | -||||
P2113R0 | -Clang 16 | -||||
Range-based for statements with initializer | -P0614R1 | -Clang 8 | -|||
ADL and function templates that are not visible | -P0846R0 | -Clang 9 | -|||
const mismatch with defaulted copy constructor | -P0641R2 | -Clang 8 | -|||
Consistent comparison (operator<=>) | -P0515R3 | -Clang 10 | -|||
P0905R1 | -|||||
P1120R0 | -|||||
P1185R2 | -|||||
P1186R3 | -|||||
P1630R1 | -|||||
P1946R0 | -|||||
P1959R0 | -|||||
P2002R1 | -Partial | -||||
P2085R0 | -Clang 14 | -||||
Access checking on specializations | -P0692R1 | -Clang 14 | -|||
Default constructible and assignable stateless lambdas | -P0624R2 | -Clang 8 | -|||
Lambdas in unevaluated contexts | -P0315R4 | -Clang 17 | -|||
[[no_unique_address]] attribute | -P0840R2 | -Clang 9 | -|||
[[likely]] and [[unlikely]] attributes | -P0479R5 | -Clang 12 | -|||
typename optional in more contexts | -P0634R3 | -Clang 16 | -|||
Pack expansion in lambda init-capture | -P0780R2 | -Clang 9 | -|||
Class types as non-type template parameters | -P0732R2 | -Partial | -|||
P1907R1 | -|||||
Destroying operator delete | -P0722R3 | -Clang 6 | -|||
Relaxations of constexpr restrictions | -P1064R0 | -Clang 9 | -|||
P1002R1 | -Clang 8 | -||||
P1327R1 | -Clang 9 | -||||
P1330R0 | -|||||
P1331R2 | -Clang 10 | -||||
P1668R1 | -|||||
P0784R7 | -|||||
Prohibit aggregates with user-declared constructors | -P1008R1 | -Clang 8 | -|||
Feature test macros | -P0941R2 | -(see below) | +|||
Variable templates | +N3651 | +Clang 3.4 | |||
explicit(bool) | -P0892R2 | -Clang 9 | -|||
Signed integers are two's complement | -P1236R1 | -Clang 9 | -|||
char8_t | -P0482R6 | -Clang 7 (11) | -|||
Immediate functions (consteval) | -P1073R3 | -
- Clang 15 (Partial)- Clang still incorrectly defers some consteval executions to runtime, - resulting in CodeGen crashes. Additionally, Clang does not properly - handle default arguments in consteval functions under all - circumstances. - |
+ Relaxing requirements on constexpr functions | +N3652 | +Clang 3.4 |
P1937R2 | -Clang 14 | -||||
std::is_constant_evaluated | -P0595R2 | -Clang 9 | +Member initializers and aggregates | +N3653 | +Clang 3.3 |
Nested inline namespaces | -P1094R2 | -Clang 8 | +Clarifying memory allocation | +N3664 | +Clang 3.4 |
Structured binding extensions | -P1091R3 | -Clang 16 | +[[deprecated]] attribute | +N3760 | +Clang 3.4 |
P1381R1 | -|||||
Stronger Unicode requirements | -P1041R4 | -Yes | +Single quotation mark as digit separator | +N3781 | +Clang 3.4 |
P1139R2 | -|||||
Parenthesized initialization of aggregates | -P0960R3 | -No | -|||
P1975R0 | -|||||
Modules | -P1103R3 | -Clang 15 | +C++ Sized Deallocation | +N3778 | +Clang 3.4 (7) |
P1766R1 (DR) | -Clang 11 | -||||
P1811R0 | -No | -||||
P1703R1 | -Subsumed by P1857 | -||||
P1874R1 | -Clang 15 | -||||
P1979R0 | -No | -||||
P1779R3 | -Clang 15 | -||||
P1857R3 | -No | -||||
P2115R0 | -Partial | -||||
P1815R2 | -Partial | -||||
P2615R1 (DR) | -No | -||||
P2788R0 (DR) | -No | +
+(7): In Clang 3.7 and later, sized deallocation is only enabled
+if the user passes the -fsized-deallocation
flag. The user must
+supply definitions of the sized deallocation functions, either by providing them
+explicitly or by using a C++ standard library that does. libstdc++
+added these functions in version 5.0, and libc++
added them in
+version 3.7.
+
+
Clang 3.3 and later implement all of the ISO + C++ 2011 standard.
+ +You can use Clang in C++11 mode with the -std=c++11
+option. Clang's C++11 mode can be used with
+libc++ or with gcc's libstdc++.
Language Feature | +C++11 Proposal | +Available in Clang? | +|||
---|---|---|---|---|---|
Rvalue references | +N2118 | +Clang 2.9 | +|||
P1825R0 (DR) | +Clang 13 | ||||
Coroutines | -P0912R5 | -
- Partial- Fully supported on all targets except Windows, which - still has some stability and ABI issues. - |
+ Rvalue references for *this |
+ N2439 | +Clang 2.9 |
Deprecate a[b,c] | -P1161R3 | -Clang 9 | +Initialization of class objects by rvalues | +N1610 | +Clang 2.9 |
Deprecate some problematic uses of volatile | -P1152R4 | -Clang 10 | +Non-static data member initializers | +N2756 | +Clang 3.0 |
[[nodiscard("with reason")]] | -P1301R4 | -Clang 9 | +Variadic templates | +N2242 | +Clang 2.9 |
using enum | -P1099R5 | -Clang 13 | +Extending variadic template template parameters | +N2555 | +Clang 2.9 |
Class template argument deduction for aggregates | -P1816R0 | -No | +Initializer lists | +N2672 | +Clang 3.1 |
P2082R1 | +|||||
P1009R2 (DR) | +Clang 9 | +||||
P1957R2 (DR) | +Clang 11 | ||||
Class template argument deduction for alias templates | -P1814R0 | -No | +Static assertions | +N1720 | +Clang 2.9 |
Permit conversions to arrays of unknown bound | -P0388R4 | -Clang 14 | +auto -typed variables |
+ N1984 | +Clang 2.9 |
constinit | -P1143R2 | -Clang 10 | + Multi-declarator auto |
+ N1737 | +Clang 2.9 |
Pseudo-destructors end object lifetimes | -P0593R6 (DR) | -Clang 11 | +Removal of auto as a storage-class specifier | +N2546 | +Clang 2.9 |
More implicit moves | -P1825R0 (DR) | -Clang 13 | +New function declarator syntax | +N2541 | +Clang 2.9 |
-(11): Prior to Clang 8, this feature is not enabled by --std=c++20, but can be enabled with -fchar8_t. - -
-Clang has support for some of the features of the ISO C++ 2023 standard.
- -You can use Clang in C++23 mode with the -std=c++23
option.
Language Feature | -C++23 Proposal | -Available in Clang? | -|||
---|---|---|---|---|---|
Literal suffix uz, z for size_t, ssize_t | -P0330R8 | -Clang 13 | +Lambda expressions | +N2927 | +Clang 3.1 |
P0588R1 (DR) | +No | +||||
Make () in lambdas optional in all cases | -P1102R2 | -Clang 13 | +Declared type of an expression | +N2343 | +Clang 2.9 |
Simpler implicit move | -P2266R1 | -Clang 13 | +Incomplete return types | +N3276 | +Clang 3.1 |
if consteval | -P1938R3 | -Clang 14 | +Right angle brackets | +N1757 | +Clang 2.9 |
Allow duplicate attributes | -P2156R1 | -Clang 13 | +Default template arguments for function templates | +DR226 | +Clang 2.9 |
Narrowing contextual conversions to bool | -P1401R5 | -Clang 14 | +Solving the SFINAE problem for expressions | +DR339 | +Clang 2.9 |
Trimming whitespaces before line splicing | -P2223R2 | -Yes | +Alias templates | +N2258 | +Clang 3.0 |
Make declaration order layout mandated | -P1874R4 | -Yes | +Extern templates | +N1987 | +Clang 2.9 |
C++ identifier syntax using UAX 31 | -P1949R7 | -Clang 14 | +Null pointer constant | +N2431 | +Clang 3.0 |
Mixed string literal concatenation | -P2201R1 | -Yes | +Strongly-typed enums | +N2347 | +Clang 2.9 |
Deducing this | -P0847R7 | -No | +Forward declarations for enums | +N2764
+ DR1206 |
+ Clang 3.1 |
P2797R0 | -No | +Standardized attribute syntax | +N2761 | +Clang 3.3 (1) | |
Change scope of lambda trailing-return-type | -P2036R3 | -Clang 17 | +Generalized constant expressions | +N2235 | +Clang 3.1 |
P0859R0 (DR) | +Clang 8 | +||||
P2579R0 | +Alignment support | +N2341 | +Clang 3.3 | ||
Multidimensional subscript operator | -P2128R6 | -Clang 15 | +Conditionally-support behavior | +N1627 | +Clang 2.9 |
Non-literal variables (and labels and gotos) in constexpr functions | -P2242R3 | -Clang 15 | +Changing undefined behavior into diagnosable errors | +N1727 | +Clang 2.9 |
Character encoding of diagnostic text | -P2246R1 | -Yes | +Delegating constructors | +N1986 | +Clang 3.0 | +
Inheriting constructors | +N2540 | +Clang 3.3 | +|||
P0136R1 (DR) | +Clang 3.9 | +||||
Explicit conversion operators | +N2437 | +Clang 3.0 | +|||
New character types | +N2249 | +Clang 2.9 | +|||
Unicode string literals | +N2442 | +Clang 3.0 | +|||
Raw string literals | +N2442 | +Clang 3.0 | |||
Character sets and encodings | -P2314R4 | -Yes | +Universal character names in literals | +N2170 | +Clang 3.1 |
Consistent character literal encoding | -P2316R2 | -Yes | +User-defined literals | +N2765 | +Clang 3.1 |
Add support for preprocessing directives elifdef and elifndef | -P2334R1 | -Clang 13 | +Standard Layout Types | +N2342 | +Clang 3.0 |
Extend init-statement to allow alias-declaration | -P2360R0 | -Clang 14 | +Defaulted functions | +N2346 | +Clang 3.0 |
P1286R2 (DR) | +Clang 9 | +||||
auto(x): decay-copy in the language | -P0849R8 | -Clang 15 | +Deleted functions | +N2346 | +Clang 2.9 |
Attributes on Lambda-Expressions | -P2173R1 | -Clang 13 | +Extended friend declarations | +N1791 | +Clang 2.9 |
constexpr for <cmath> and <cstdlib> | -P0533R9 | -No | +Extending sizeof |
+ N2253
+ DR850 |
+ Clang 3.1 |
Type trait to determine if a reference binds to a temporary | -P2255R2 | -
- Partial- Clang provides a __reference_binds_to_temporary type trait - builtin, with which the library facility can be partially implemented. - Both __reference_constructs_from_temporary and - __reference_converts_from_temporary builtins should be - provided, following the normal cross-vendor convention to implement - traits requiring compiler support directly. - |
-
+ Inline namespaces | +N2535 | +Clang 2.9 |
The Equality Operator You Are Looking For | -P2468R2 | -Clang 16 | +Unrestricted unions | +N2544 | +Clang 3.1 |
De-deprecating volatile compound operations | -P2327R1 | -Clang 15 | +Local and unnamed types as template arguments | +N2657 | +Clang 2.9 |
Support for #warning |
- P2437R1 | -Yes | +Range-based for | +N2930 | +Clang 3.0 |
P0962R1 (DR) | +Clang 8 | +||||
Remove non-encodable wide character literals and multicharacter wide character literals | -P2362R3 | -Clang 14 | +Explicit virtual overrides | +N2928
+ N3206 + N3272 |
+ Clang 3.0 |
Labels at the end of compound statements | -P2324R2 | -Clang 16 | +Minimal support for garbage collection and reachability-based leak detection | +N2670 | +N/A (2) |
Delimited escape sequences | -P2290R3 | -Clang 15 | +Allowing move constructors to throw [noexcept] | +N3050 | +Clang 3.0 |
Named universal character escapes | -P2071R2 | -Clang 15 | +Defining move special member functions | +N3053 | +Clang 3.0 |
Relaxing some constexpr restrictions | -P2448R2 | -
- Clang 17 (Partial)- We do not support outside of defaulted special memeber functions the change that constexpr functions no - longer have to be constexpr compatible but rather support a less restricted requirements for constexpr - functions. Which include allowing non-literal types as return values and parameters, allow calling of - non-constexpr functions and constructors. - |
-
+
+ |||
Concurrency | |||||
Using unknown pointers and references in constant expressions | -P2280R4 | -No | +Sequence points | +N2239 | +Clang 3.3 |
static operator() |
- P1169R4 | -Clang 16 | +Atomic operations | +N2427 | +Clang 3.1 |
Extended floating-point types and standard names | -P1467R9 | -No | +Strong Compare and Exchange | +N2748 | +Clang 3.1 (3) |
Class template argument deduction from inherited constructors | -P2582R1 | -No | +Bidirectional Fences | +N2752 | +Clang 3.1 |
Portable assumptions | -P1774R8 | -No | +Memory model | +N2429 | +Clang 3.2 |
Support for UTF-8 as a portable source file encoding | -P2295R6 | -Clang 15 | +Data-dependency ordering: atomics and memory model | +N2664 | +Clang 3.2 (4) |
char8_t Compatibility and Portability Fix |
- P2513R3 | -Clang 16 | +Propagating exceptions | +N2179 | +Clang 2.9 |
Relax requirements on wchar_t to match existing practices |
- P2460R2 | -Yes | +Allow atomics use in signal handlers | +N2547 | +Clang 3.1 |
Explicit lifetime management | -P2590R2 | -No | +Thread-local storage | +N2659 | +Clang 3.3 (5) |
static operator[] |
- P2589R1 | -Clang 16 | +Dynamic initialization and destruction with concurrency | +N2660 | +Clang 2.9 | +
C99 Features in C++11 | |||||
Permitting static constexpr variables in constexpr functions | -P2647R1 | -Clang 16 | +__func__ predefined identifier |
+ N2340 | +Clang 2.9 |
consteval needs to propagate up | -P2564R3 (DR) | -No | +C99 preprocessor | +N1653 | +Clang 2.9 |
Lifetime extension in range-based for loops | -P2718R0 | -No | +long long |
+ N1811 | +Clang 2.9 |
Referencing The Unicode Standard | -P2736R2 | -Yes | +Extended integral types | +N1988 | +N/A (6) |
+(1): The [[carries_dependency]]
attribute
+has no effect.
+(2): No compiler changes are required for an implementation
+such as Clang that does not provide garbage collection.
+(3): All compare-exchange operations are emitted as
+strong compare-exchanges.
+(4): memory_order_consume
is lowered to
+memory_order_acquire
.
+(5): thread_local
support
+requires a C++ runtime library providing __cxa_thread_atexit
, such
+as libc++abi 3.6 or later,
+or libsupc++ 4.8 or later.
+(6): No compiler changes are required for an implementation
+such as Clang that does not provide any extended integer types.
+__int128
is not treated as an extended integer type,
+because changing intmax_t
would be an ABI-incompatible
+change.
+
Clang has support for some of the features of the C++ standard following -C++23, informally referred to as C++26.
-You can use Clang in C++2c mode with the -std=c++2c
option.
Language Feature | -C++26 Proposal | -Available in Clang? | -
---|
Clang implements all of the ISO C++ 1998 standard + (including the defects addressed in the ISO C++ 2003 standard) + except for export (which was removed in C++11).