4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
5 <title>Clang - C++ Programming Language Status
</title>
6 <link type=
"text/css" rel=
"stylesheet" href=
"menu.css">
7 <link type=
"text/css" rel=
"stylesheet" href=
"content.css">
8 <style type=
"text/css">
9 .none { background-color: #FFCCCC }
10 .partial { background-color: #FFE0B0 }
11 .unreleased { background-color: #FFFF99 }
12 .full { background-color: #CCFF99 }
13 .na { background-color: #DDDDDD }
14 :target
{ background-color: #FFFFBB; outline: #DDDD55 solid thin
; }
15 th
{ background-color: #FFDDAA }
16 td
{ vertical-align: middle
}
17 tt
{ white-space: nowrap
}
22 <!--#include virtual="menu.html.incl"-->
26 <!--*************************************************************************-->
27 <h1>C++ Support in Clang
</h1>
28 <!--*************************************************************************-->
30 <p>Clang implements the following published and upcoming ISO C++ standards:
</p>
32 <table width=
"689" border=
"1" cellspacing=
"0">
34 <th>Language Standard
</th>
36 <th>Available in Clang?
</th>
39 <td><a href=
"#cxx26">C++
2c
</a></td>
40 <td><tt>-std=c++
2c
</tt></td>
41 <td class=
"partial" align=
"center">Partial
</td>
44 <td><a href=
"#cxx23">C++
23</a></td>
45 <td><tt>-std=c++
23</tt></td>
46 <td class=
"partial" align=
"center">Partial
</td>
49 <td><a href=
"#cxx20">C++
20</a></td>
50 <td><tt>-std=c++
20</tt></td>
51 <td class=
"partial" align=
"center">Partial
</td>
54 <td><a href=
"#cxx17">C++
17</a></td>
55 <td><tt>-std=c++
17</tt></td>
56 <td class=
"full" align=
"center">Clang
5</td>
59 <td><a href=
"#cxx14">C++
14</a></td>
60 <td><tt>-std=c++
14</tt></td>
61 <td class=
"full" align=
"center">Clang
3.4</td>
64 <td><a href=
"#cxx11">C++
11</a></td>
65 <td><tt>-std=c++
11</tt></td>
66 <td class=
"full" align=
"center">Clang
3.3</td>
69 <td><a href=
"#cxx98">C++
98 / C++
03</a></td>
70 <td><tt>-std=c++
98</tt></td>
71 <td class=
"full" align=
"center">Yes (other than
<tt>export
</tt>)
</td>
75 <p>The Clang community is continually striving to improve C++ standards
76 compliance between releases by submitting and tracking
<a
77 href=
"cxx_dr_status.html">C++ Defect Reports
</a> and implementing resolutions
78 as they become available.
</p>
80 <p>Experimental work is also under way to implement
<a href=
"#ts">C++ Technical
81 Specifications
</a> that will help drive the future of the C++ programming
84 <p>The
<a href=
"https://github.com/llvm/llvm-project/issues/">LLVM bug tracker
</a> uses
85 the
"c++" label, as well as mode-specific labels such as
"c++11",
"c++14",
86 and so on, to track known bugs with Clang's language conformance.
</p>
88 <h2 id=
"cxx26">C++
2c implementation status
</h2>
90 <!-- TODO add link to the ISO Standard after it's published. -->
91 <p>Clang has support for some of the features of the C++ standard following
92 C++
23, informally referred to as C++
26.
</p>
94 <p>You can use Clang in C++
2c mode with the
<code>-std=c++
2c
</code> option.
</p>
97 <summary>List of features and minimum Clang version with support
</summary>
98 <table width=
"689" border=
"1" cellspacing=
"0">
100 <th>Language Feature
</th>
101 <th>C++
26 Proposal
</th>
102 <th>Available in Clang?
</th>
104 <!-- Spring 2023 papers (Varna) -->
106 <td>Remove undefined behavior from lexing
</td>
107 <td><a href=
"https://wg21.link/P2621R2">P2621R2
</a> (
<a href=
"#dr">DR
</a>)
</td>
108 <td class=
"full" align=
"center">Clang
3.3</td>
111 <td>Making non-encodable string literals ill-formed
</td>
112 <td><a href=
"https://wg21.link/P1854R4">P1854R4
</a> (
<a href=
"#dr">DR
</a>)
</td>
113 <td class=
"full" align=
"center">Clang
14</td>
116 <td>Unevaluated strings
</td>
117 <td><a href=
"https://wg21.link/P2361R6">P2361R6
</a></td>
118 <td class=
"unreleased" align=
"center">Clang
18</td>
121 <td>Add @, $, and ` to the basic character set
</td>
122 <td><a href=
"https://wg21.link/P2558R2">P2558R2
</a></td>
123 <td class=
"full" align=
"center">Yes
</td>
126 <td>constexpr cast from
<tt>void*
</tt></td>
127 <td><a href=
"https://wg21.link/P2738R1">P2738R1
</a></td>
128 <td class=
"full" align=
"center">Clang
17</td>
131 <td>On the ignorability of standard attributes
</td>
132 <td><a href=
"https://wg21.link/P2552R3">P2552R3
</a> (
<a href=
"#dr">DR
</a>)
</td>
133 <td class=
"none" align=
"center">No
</td>
136 <td>Static storage for braced initializers
</td>
137 <td><a href=
"https://wg21.link/P2752R3">P2752R3
</a> (
<a href=
"#dr">DR
</a>)
</td>
138 <td class=
"none" align=
"center">No
</td>
141 <td>User-generated
<tt>static_assert
</tt> messages
</td>
142 <td><a href=
"https://wg21.link/P2741R3">P2741R3
</a></td>
143 <td class=
"full" align=
"center">Clang
17</td>
146 <td>Placeholder variables with no name
</td>
147 <td><a href=
"https://wg21.link/P2169R4">P2169R4
</a></td>
148 <td class=
"unreleased" align=
"center">Clang
18</td>
153 <h2 id=
"cxx23">C++
23 implementation status
</h2>
155 <!-- TODO add link to the ISO Standard after it's published. -->
156 <p>Clang has support for some of the features of the ISO C++
2023 standard.
</p>
158 <p>You can use Clang in C++
23 mode with the
<code>-std=c++
23</code> option.
</p>
161 <summary>List of features and minimum Clang version with support
</summary>
163 <table width=
"689" border=
"1" cellspacing=
"0">
165 <th>Language Feature
</th>
166 <th>C++
23 Proposal
</th>
167 <th>Available in Clang?
</th>
169 <!-- Fall 2020 papers -->
171 <td>Literal suffix
<tt>uz
</tt>,
<tt>z
</tt> for
<tt>size_t
</tt>,
<tt>ssize_t
</tt></td>
172 <td><a href=
"https://wg21.link/p0330r8">P0330R8
</a></td>
173 <td class=
"full" align=
"center">Clang
13</td>
175 <!-- Spring 2021 papers -->
177 <td>Make
<tt>()
</tt> in lambdas optional in all cases
</td>
178 <td><a href=
"https://wg21.link/p1102r2">P1102R2
</a></td>
179 <td class=
"full" align=
"center">Clang
13</td>
182 <td>Simpler implicit move
</td>
183 <td><a href=
"https://wg21.link/p2266r1">P2266R1
</a></td>
184 <td class=
"full" align=
"center">Clang
13</td>
187 <td><tt>if consteval
</tt></td>
188 <td><a href=
"https://wg21.link/P1938R3">P1938R3
</a></td>
189 <td class=
"full" align=
"center">Clang
14</td>
192 <td>Allow duplicate attributes
</td>
193 <td><a href=
"https://wg21.link/P2156R1">P2156R1
</a></td>
194 <td class=
"full" align=
"center">Clang
13</td>
197 <td>Narrowing contextual conversions to bool
</td>
198 <td><a href=
"https://wg21.link/P1401R5">P1401R5
</a></td>
199 <td class=
"full" align=
"center">Clang
14</td>
202 <td>Trimming whitespaces before line splicing
</td>
203 <td><a href=
"https://wg21.link/P2223R2">P2223R2
</a></td>
204 <td class=
"full" align=
"center">Yes
</td>
207 <td>Make declaration order layout mandated
</td>
208 <td><a href=
"https://wg21.link/p1847r4">P1874R4
</a></td>
209 <td class=
"full" align=
"center">Yes
</td>
212 <td>C++ identifier syntax using UAX
31</td>
213 <td><a href=
"https://wg21.link/P1949R7">P1949R7
</a></td>
214 <td class=
"full" align=
"center">Clang
14</td>
217 <td>Mixed string literal concatenation
</td>
218 <td><a href=
"https://wg21.link/p2201r1">P2201R1
</a></td>
219 <td class=
"full" align=
"center">Yes
</td>
221 <!-- October 2021 papers -->
223 <td rowspan=
2>Deducing this
</td>
224 <td><a href=
"https://wg21.link/P0847R7">P0847R7
</a></td>
225 <td class=
"unreleased" align=
"center">Clang
18</td>
228 <td><a href=
"https://wg21.link/P2797R0">P2797R0
</a></td>
229 <td class=
"none" align=
"center">No
</td>
232 <td rowspan=
2>Change scope of lambda trailing-return-type
</td>
233 <td><a href=
"https://wg21.link/P2036R3">P2036R3
</a></td>
234 <td rowspan=
2 class=
"full" align=
"center">Clang
17</td>
237 <td><a href=
"https://wg21.link/P2579R0">P2579R0
</a></td>
240 <td>Multidimensional subscript operator
</td>
241 <td><a href=
"https://wg21.link/P2128R6">P2128R6
</a></td>
242 <td class=
"full" align=
"center">Clang
15</td>
245 <td>Non-literal variables (and labels and gotos) in constexpr functions
</td>
246 <td><a href=
"https://wg21.link/P2242R3">P2242R3
</a></td>
247 <td class=
"full" align=
"center">Clang
15</td>
250 <td>Character encoding of diagnostic text
</td>
251 <td><a href=
"https://wg21.link/P2246R1">P2246R1
</a></td>
252 <td class=
"full" align=
"center">Yes
</td>
255 <td>Character sets and encodings
</td>
256 <td><a href=
"https://wg21.link/P2314R4">P2314R4
</a></td>
257 <td class=
"full" align=
"center">Yes
</td>
260 <td>Consistent character literal encoding
</td>
261 <td><a href=
"https://wg21.link/P2316R2">P2316R2
</a></td>
262 <td class=
"full" align=
"center">Yes
</td>
265 <td>Add support for preprocessing directives elifdef and elifndef
</td>
266 <td><a href=
"https://wg21.link/P2334R1">P2334R1
</a></td>
267 <td class=
"full" align=
"center">Clang
13</td>
270 <td>Extend init-statement to allow alias-declaration
</td>
271 <td><a href=
"https://wg21.link/P2360R0">P2360R0
</a></td>
272 <td class=
"full" align=
"center">Clang
14</td>
275 <td>auto(x): decay-copy in the language
</td>
276 <td><a href=
"https://wg21.link/P0849R8">P0849R8
</a></td>
277 <td class=
"full" align=
"center">Clang
15</td>
279 <!-- February 2022 papers -->
281 <td>Attributes on Lambda-Expressions
</td>
282 <td><a href=
"https://wg21.link/P2173R1">P2173R1
</a></td>
283 <td class=
"full" align=
"center">Clang
13</td>
286 <td><tt>constexpr
</tt> for
<tt><cmath
></tt> and
<tt><cstdlib
></tt></td>
287 <td><a href=
"https://wg21.link/P0533R9">P0533R9
</a></td>
288 <td class=
"none" align=
"center">No
</td>
291 <td>Type trait to determine if a reference binds to a temporary
</td>
292 <td><a href=
"https://wg21.link/P2255R2">P2255R2
</a></td>
293 <td class=
"partial" align=
"center">
294 <details><summary>Partial
</summary>
295 Clang provides
<tt>__reference_constructs_from_temporary
</tt> type
296 trait builtin, with which
<tt>std::reference_constructs_from_temporary
</tt>
297 is implemented.
<tt>__reference_converts_from_temporary
</tt> needs to be
298 provided, following the normal cross-vendor convention to implement
299 traits requiring compiler support directly.
303 <!-- July 2022 papers -->
305 <td>The Equality Operator You Are Looking For
</td>
306 <td><a href=
"https://wg21.link/P2468R2">P2468R2
</a></td>
307 <td class=
"full" align=
"center">Clang
16</td>
310 <td>De-deprecating volatile compound operations
</td>
311 <td><a href=
"https://wg21.link/P2327R1">P2327R1
</a></td>
312 <td class=
"full" align=
"center">Clang
15</td>
315 <td>Support for
<code>#warning
</code></td>
316 <td><a href=
"https://wg21.link/P2437R1">P2437R1
</a></td>
317 <td class=
"full" align=
"center">Yes
</td>
320 <td>Remove non-encodable wide character literals and multicharacter wide character literals
</td>
321 <td><a href=
"https://wg21.link/P2362R3">P2362R3
</a></td>
322 <td class=
"full" align=
"center">Clang
14</td>
325 <td>Labels at the end of compound statements
</td>
326 <td><a href=
"https://wg21.link/P2324R2">P2324R2
</a></td>
327 <td class=
"full" align=
"center">Clang
16</td>
330 <td>Delimited escape sequences
</td>
331 <td><a href=
"https://wg21.link/P2290R3">P2290R3
</a></td>
332 <td class=
"full" align=
"center">Clang
15</td>
335 <td>Named universal character escapes
</td>
336 <td><a href=
"https://wg21.link/P2071R2">P2071R2
</a></td>
337 <td class=
"full" align=
"center">Clang
15</td>
340 <td>Relaxing some constexpr restrictions
</td>
341 <td><a href=
"https://wg21.link/P2448R2">P2448R2
</a></td>
342 <td class=
"partial" align=
"center">
343 <details><summary>Clang
17 (Partial)
</summary>
344 We do not support outside of defaulted special memeber functions the change that constexpr functions no
345 longer have to be constexpr compatible but rather support a less restricted requirements for constexpr
346 functions. Which include allowing non-literal types as return values and parameters, allow calling of
347 non-constexpr functions and constructors.
352 <td>Using unknown pointers and references in constant expressions
</td>
353 <td><a href=
"https://wg21.link/P2280R4">P2280R4
</a> (
<a href=
"#dr">DR
</a>)
</td>
354 <td class=
"none" align=
"center">No
</td>
357 <td>static
<code>operator()
</code></td>
358 <td><a href=
"https://wg21.link/P1169R4">P1169R4
</a></td>
359 <td class=
"full" align=
"center">Clang
16</td>
362 <td>Extended floating-point types and standard names
</td>
363 <td><a href=
"https://wg21.link/P1467R9">P1467R9
</a></td>
364 <td class=
"none" align=
"center">No
</td>
367 <td>Class template argument deduction from inherited constructors
</td>
368 <td><a href=
"https://wg21.link/P2582R1">P2582R1
</a></td>
369 <td class=
"none" align=
"center">No
</td>
372 <td>Portable assumptions
</td>
373 <td><a href=
"https://wg21.link/P1774R8">P1774R8
</a></td>
374 <td class=
"none" align=
"center">No
</td>
377 <td>Support for UTF-
8 as a portable source file encoding
</td>
378 <td><a href=
"https://wg21.link/P2295R6">P2295R6
</a></td>
379 <td class=
"full" align=
"center">Clang
15</td>
382 <td><code>char8_t
</code> Compatibility and Portability Fix
</td>
383 <td><a href=
"https://wg21.link/P2513R3">P2513R3
</a></td>
384 <td class=
"full" align=
"center">Clang
16</td>
387 <td>Relax requirements on
<code>wchar_t
</code> to match existing practices
</td>
388 <td><a href=
"https://wg21.link/P2460R2">P2460R2
</a></td>
389 <td class=
"full" align=
"center">Yes
</td>
392 <td>Explicit lifetime management
</td>
393 <td><a href=
"https://wg21.link/P2590R2">P2590R2
</a></td>
394 <td class=
"none" align=
"center">No
</td>
396 <!-- November 2022 (Kona) papers -->
398 <td>static
<code>operator[]
</code></td>
399 <td><a href=
"https://wg21.link/P2589R1">P2589R1
</a></td>
400 <td class=
"full" align=
"center">Clang
16</td>
403 <td>Permitting static constexpr variables in constexpr functions
</td>
404 <td><a href=
"https://wg21.link/P2647R1">P2647R1
</a></td>
405 <td class=
"full" align=
"center">Clang
16</td>
408 <td>consteval needs to propagate up
</td>
409 <td><a href=
"https://wg21.link/P2564R3">P2564R3
</a> (
<a href=
"#dr">DR
</a>)
</td>
410 <td class=
"full" align=
"center">Clang
17</td>
413 <td>Lifetime extension in range-based for loops
</td>
414 <td><a href=
"https://wg21.link/P2718R0">P2718R0
</a></td>
415 <td class=
"none" align=
"center">No
</td>
417 <!--Issaquah 2023 papers-->
419 <td>Referencing The Unicode Standard
</td>
420 <td><a href=
"https://wg21.link/P2736R2">P2736R2
</a></td>
421 <td class=
"full" align=
"center">Yes
</td>
427 <h2 id=
"cxx20">C++
20 implementation status
</h2>
429 <p>Clang has support for some of the features of the
430 <a href=
"https://www.iso.org/standard/79358.html">ISO C++
2020 standard
</a>.
</p>
432 <p>You can use Clang in C++
20 mode with the
<code>-std=c++
20</code> option
433 (use
<code>-std=c++
2a
</code> in Clang
9 and earlier).
</p>
436 <summary>List of features and minimum Clang version with support
</summary>
438 <table width=
"689" border=
"1" cellspacing=
"0">
440 <th>Language Feature
</th>
441 <th>C++
20 Proposal
</th>
442 <th>Available in Clang?
</th>
444 <!-- Toronto 2017 papers -->
446 <td>Default member initializers for bit-fields
</td>
447 <td><a href=
"https://wg21.link/p0683r1">P0683R1
</a></td>
448 <td class=
"full" align=
"center">Clang
6</td>
451 <td><tt>const
&</tt>-qualified pointers to members
</td>
452 <td><a href=
"https://wg21.link/p0704r1">P0704R1
</a></td>
453 <td class=
"full" align=
"center">Clang
6</td>
456 <td>Allow
<i>lambda-capture
</i> <tt>[=, this]
</tt></td>
457 <td><a href=
"https://wg21.link/p0409r2">P0409R2
</a></td>
458 <td class=
"full" align=
"center">Clang
6</td>
461 <td rowspan=
"2"><tt>__VA_OPT__
</tt> for preprocessor comma elision
</td>
462 <td><a href=
"https://wg21.link/p0306r4">P0306R4
</a></td>
463 <td class=
"full" align=
"center">Clang
6</td>
465 <tr> <!-- from Rapperswil -->
466 <td><a href=
"https://wg21.link/p1042r1">P1042R1
</a></td>
467 <td class=
"full" align=
"center">Clang
9</td>
470 <td>Designated initializers
</td>
471 <td><a href=
"https://wg21.link/p0329r4">P0329R4
</a></td>
472 <td class=
"full" align=
"center">Clang
10</td>
475 <td><i>template-parameter-list
</i> for generic lambdas
</td>
476 <td><a href=
"https://wg21.link/p0428r2">P0428R2
</a></td>
477 <td class=
"full" align=
"center">Clang
9</td>
480 <td rowspan=
"13">Concepts
</td>
481 <td><a href=
"https://wg21.link/p0734r0">P0734R0
</a></td>
482 <td class=
"full" align=
"center">Clang
10</td>
484 <tr> <!-- from Albuquerque -->
485 <td><a href=
"https://wg21.link/p0857r0">P0857R0
</a></td>
486 <td rowspan=
"1" class=
"full" align=
"center">Clang
16</td>
488 <tr> <!-- from San Diego -->
489 <td><a href=
"https://wg21.link/p1084r2">P1084R2
</a></td>
490 <td rowspan=
"2" class=
"full" align=
"center">Clang
10</td>
493 <td><a href=
"https://wg21.link/p1141r2">P1141R2
</a></td>
495 <tr> <!-- from Cologne -->
496 <td><a href=
"https://wg21.link/p0848r3">P0848R3
</a></td>
497 <td rowspan=
"1" class=
"partial" align=
"center">
499 <summary>Clang
16 (Partial)
</summary>
500 Because of other concepts implementation deficits, the __cpp_concepts macro is not yet set to
202002L.
501 Also, the related defect reports
<a href=
"https://wg21.link/cwg1496">DR1496
</a> and
502 <a href=
"https://wg21.link/cwg1734">DR1734
</a> are not yet implemented. Accordingly, deleted
503 special member functions are treated as eligible even though they shouldn't be.
508 <td><a href=
"https://wg21.link/p1616r1">P1616R1
</a></td>
509 <td rowspan=
"2" class=
"full" align=
"center">Clang
10</td>
512 <td><a href=
"https://wg21.link/p1452r2">P1452R2
</a></td>
514 <tr> <!-- from Belfast -->
515 <td><a href=
"https://wg21.link/p1972r0">P1972R0
</a></td>
516 <td rowspan=
"4" class=
"full" align=
"center">Clang
10</td>
519 <td><a href=
"https://wg21.link/p1980r0">P1980R0
</a></td>
521 <tr> <!-- from Prague -->
522 <td><a href=
"https://wg21.link/p2103r0">P2103R0
</a></td>
524 <tr> <!-- from February 2022 -->
525 <td><a href=
"https://wg21.link/p2493r0">P2493R0
</a></td>
528 <td><a href=
"https://wg21.link/p2092r0">P2092R0
</a></td>
529 <td rowspan=
"1" class=
"full" align=
"center">Clang
16</td>
532 <td><a href=
"https://wg21.link/p2113r0">P2113R0
</a></td>
533 <td rowspan=
"1" class=
"full" align=
"center">Clang
16</td>
535 <!-- Albuquerque papers -->
537 <td>Range-based for statements with initializer
</td>
538 <td><a href=
"https://wg21.link/p0614r1">P0614R1
</a></td>
539 <td class=
"full" align=
"center">Clang
8</td>
542 <td>ADL and function templates that are not visible
</td>
543 <td><a href=
"https://wg21.link/p0846r0">P0846R0
</a></td>
544 <td class=
"full" align=
"center">Clang
9</td>
547 <td><tt>const
</tt> mismatch with defaulted copy constructor
</td>
548 <td><a href=
"https://wg21.link/p0641r2">P0641R2
</a></td>
549 <td class=
"full" align=
"center">Clang
8</td>
552 <td rowspan=
"10">Consistent comparison (
<tt>operator
<=
></tt>)
</td>
553 <td><a href=
"https://wg21.link/p0515r3">P0515R3
</a></td>
554 <td rowspan=
"8" class=
"full" align=
"center">Clang
10</td>
556 <tr> <!-- from Jacksonville -->
557 <td><a href=
"https://wg21.link/p0905r1">P0905R1
</a></td>
559 <tr> <!-- from Rapperswil -->
560 <td><a href=
"https://wg21.link/p1120r0">P1120R0
</a></td>
562 <tr> <!-- from Kona 2019 -->
563 <td><a href=
"https://wg21.link/p1185r2">P1185R2
</a></td>
565 <tr> <!-- from Cologne -->
566 <td><a href=
"https://wg21.link/p1186r3">P1186R3
</a></td>
569 <td><a href=
"https://wg21.link/p1630r1">P1630R1
</a></td>
571 <tr> <!-- from Belfast -->
572 <td><a href=
"https://wg21.link/p1946r0">P1946R0
</a></td>
575 <td><a href=
"https://wg21.link/p1959r0">P1959R0
</a></td>
577 <tr> <!-- from Prague -->
578 <td><a href=
"https://wg21.link/p2002r1">P2002R1
</a></td>
579 <td class=
"full" align=
"center">Clang
17</td>
582 <td><a href=
"https://wg21.link/p2085r0">P2085R0
</a></td>
583 <td class=
"full" align=
"center">Clang
14</td>
586 <td>Access checking on specializations
</td>
587 <td><a href=
"https://wg21.link/p0692r1">P0692R1
</a></td>
588 <td class=
"full" align=
"center">Clang
14</td>
591 <td>Default constructible and assignable stateless lambdas
</td>
592 <td><a href=
"https://wg21.link/p0624r2">P0624R2
</a></td>
593 <td class=
"full" align=
"center">Clang
8</td>
596 <td>Lambdas in unevaluated contexts
</td>
597 <td><a href=
"https://wg21.link/p0315r4">P0315R4
</a></td>
598 <td class=
"full" align=
"center">Clang
17</td>
600 <!-- Jacksonville papers -->
602 <td><tt>[[no_unique_address]]
</tt> attribute
</td>
603 <td><a href=
"https://wg21.link/p0840r2">P0840R2
</a></td>
604 <td class=
"full" align=
"center">Clang
9</td>
607 <td><tt>[[likely]]
</tt> and
<tt>[[unlikely]]
</tt> attributes
</td>
608 <td><a href=
"https://wg21.link/p0479r5">P0479R5
</a></td>
609 <td class=
"full" align=
"center">Clang
12</td>
612 <td><tt>typename
</tt> optional in more contexts
</td>
613 <td><a href=
"https://wg21.link/p0634r3">P0634R3
</a></td>
614 <td class=
"full" align=
"center">Clang
16</td>
617 <td>Pack expansion in lambda
<i>init-capture
</i></td>
618 <td><a href=
"https://wg21.link/p0780r2">P0780R2
</a></td>
619 <td class=
"full" align=
"center">Clang
9</td>
621 <!-- Rapperswil papers -->
623 <td rowspan=
"2">Class types as non-type template parameters
</td>
624 <td><a href=
"https://wg21.link/p0732r2">P0732R2
</a></td>
625 <td rowspan=
"2" class=
"partial" align=
"center">Partial
</td>
627 <tr> <!-- from Belfast -->
628 <td><a href=
"https://wg21.link/p1907r1">P1907R1
</a></td>
631 <td>Destroying operator delete
</td>
632 <td><a href=
"https://wg21.link/p0722r3">P0722R3
</a></td>
633 <td class=
"full" align=
"center">Clang
6</td>
636 <td rowspan=
"7">Relaxations of
<tt>constexpr
</tt> restrictions
</td>
637 <td><a href=
"https://wg21.link/p1064r0">P1064R0
</a></td>
638 <td class=
"full" align=
"center">Clang
9</td>
640 <tr> <!-- from San Diego -->
641 <td><a href=
"https://wg21.link/p1002r1">P1002R1
</a></td>
642 <td class=
"full" align=
"center">Clang
8</td>
645 <td><a href=
"https://wg21.link/p1327r1">P1327R1
</a></td>
646 <td rowspan=
"2" class=
"full" align=
"center">Clang
9</td>
649 <td><a href=
"https://wg21.link/p1330r0">P1330R0
</a></td>
651 <tr> <!-- from Cologne -->
652 <td><a href=
"https://wg21.link/p1331r2">P1331R2
</a></td>
653 <td rowspan=
"3" class=
"full" align=
"center">Clang
10</td>
656 <td><a href=
"https://wg21.link/p1668r1">P1668R1
</a></td>
659 <td><a href=
"https://wg21.link/p0784r7">P0784R7
</a></td>
662 <td>Prohibit aggregates with user-declared constructors
</td>
663 <td><a href=
"https://wg21.link/p1008r1">P1008R1
</a></td>
664 <td class=
"full" align=
"center">Clang
8</td>
667 <td>Feature test macros
</td>
668 <td><a href=
"https://wg21.link/p0941r2">P0941R2
</a></td>
669 <td class=
"full" align=
"center"><a href=
"#sd6">(see below)
</a></td>
672 <td><tt>explicit(bool)
</tt></td>
673 <td><a href=
"https://wg21.link/p0892r2">P0892R2
</a></td>
674 <td class=
"full" align=
"center">Clang
9</td>
676 <!-- San Diego papers -->
678 <td>Signed integers are two's complement
</td>
679 <td><a href=
"https://wg21.link/p1236r1">P1236R1
</a></td>
680 <td class=
"full" align=
"center">Clang
9</td>
683 <td><tt>char8_t
</tt></td>
684 <td><a href=
"https://wg21.link/p0482r6">P0482R6
</a></td>
685 <td class=
"full" align=
"center">Clang
7 <a href=
"#p0482">(
11)
</a></td>
688 <td rowspan=
2>Immediate functions (
<tt>consteval
</tt>)
</td>
689 <td><a href=
"https://wg21.link/p1073r3">P1073R3
</a></td>
690 <td class=
"full" align=
"center">Clang
17</td>
692 <tr> <!-- from Prague -->
693 <td><a href=
"https://wg21.link/p1937r2">P1937R2
</a></td>
694 <td class=
"full" align=
"center">Clang
14</td>
697 <td><tt>std::is_constant_evaluated
</tt></td>
698 <td><a href=
"https://wg21.link/p0595r2">P0595R2
</a></td>
699 <td class=
"full" align=
"center">Clang
9</td>
702 <td>Nested inline namespaces
</td>
703 <td><a href=
"https://wg21.link/p1094r2">P1094R2
</a></td>
704 <td class=
"full" align=
"center">Clang
8</td>
706 <!-- Kona 2019 papers -->
708 <td rowspan=
"2">Structured binding extensions
</td>
709 <td><a href=
"https://wg21.link/p1091r3">P1091R3
</a></td>
710 <td rowspan=
"2" class=
"full" align=
"center">Clang
16</td>
713 <td><a href=
"https://wg21.link/p1381r1">P1381R1
</a></td>
716 <td rowspan=
"2">Stronger Unicode requirements
</td>
717 <td><a href=
"https://wg21.link/p1041r4">P1041R4
</a></td>
718 <td rowspan=
"2" class=
"full" align=
"center">Yes
</td>
721 <td><a href=
"https://wg21.link/p1139r2">P1139R2
</a></td>
724 <td rowspan=
"2">Parenthesized initialization of aggregates
</td>
725 <td><a href=
"https://wg21.link/p0960r3">P0960R3
</a></td>
726 <td rowspan=
"2" class=
"full" align=
"center">Clang
16</td>
728 <tr> <!-- from Belfast -->
729 <td><a href=
"https://wg21.link/p1975r0">P1975R0
</a></td>
732 <td rowspan=
"12">Modules
</td>
733 <td><a href=
"https://wg21.link/p1103r3">P1103R3
</a></td>
734 <td class=
"full" align=
"center">Clang
15</td>
736 <tr> <!-- from Cologne -->
737 <td><a href=
"https://wg21.link/p1766r1">P1766R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
738 <td class=
"full" align=
"center">Clang
11</td>
741 <td><a href=
"https://wg21.link/p1811r0">P1811R0
</a></td>
742 <td class=
"none" align=
"center">No
</td>
745 <td><a href=
"https://wg21.link/p1703r1">P1703R1
</a></td>
746 <td class=
"none" align=
"center">Subsumed by P1857
</td>
748 <tr> <!-- from Belfast -->
749 <td><a href=
"https://wg21.link/p1874r1">P1874R1
</a></td>
750 <td class=
"full" align=
"center">Clang
15</td>
752 <tr> <!-- from Belfast -->
753 <td><a href=
"https://wg21.link/p1979r0">P1979R0
</a></td>
754 <td class=
"none" align=
"center">No
</td>
756 <tr> <!-- from Prague -->
757 <td><a href=
"https://wg21.link/p1779r3">P1779R3
</a></td>
758 <td class=
"full" align=
"center">Clang
15</td>
761 <td><a href=
"https://wg21.link/p1857r3">P1857R3
</a></td>
762 <td class=
"none" align=
"center">No
</td>
765 <td><a href=
"https://wg21.link/p2115r0">P2115R0
</a></td>
766 <td class=
"partial" align=
"center">Partial
</td>
769 <td><a href=
"https://wg21.link/p1815r2">P1815R2
</a></td>
770 <td class=
"partial" align=
"center">Partial
</td>
772 <tr> <!-- from Kona 2022 -->
773 <td><a href=
"https://wg21.link/P2615R1">P2615R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
774 <td class=
"none" align=
"center">No
</td>
776 <tr> <!-- from Issaquah 2023 -->
777 <td><a href=
"https://wg21.link/P2788R0">P2788R0
</a> (
<a href=
"#dr">DR
</a>)
</td>
778 <td class=
"none" align=
"center">No
</td>
782 <td><a href=
"https://wg21.link/p0912r5">P0912R5
</a></td>
783 <td class=
"partial" align=
"center">
784 <details><summary>Partial
</summary>
785 Fully supported on all targets except Windows, which
786 still has some stability and ABI issues.
789 <!-- Cologne 2019 papers -->
791 <td>Deprecate
<tt>a[b,c]
</tt></td>
792 <td><a href=
"https://wg21.link/p1161r3">P1161R3
</a></td>
793 <td class=
"full" align=
"center">Clang
9</td>
796 <td>Deprecate some problematic uses of
<tt>volatile
</tt></td>
797 <td><a href=
"https://wg21.link/p1152r4">P1152R4
</a></td>
798 <td class=
"full" align=
"center">Clang
10</td>
801 <td><tt>[[nodiscard(
"with reason")]]
</tt></td>
802 <td><a href=
"https://wg21.link/p1301r4">P1301R4
</a></td>
803 <td class=
"full" align=
"center">Clang
9</td>
806 <td><tt>using enum
</tt></td>
807 <td><a href=
"https://wg21.link/p1099r5">P1099R5
</a></td>
808 <td class=
"full" align=
"center">Clang
13</td>
811 <td rowspan=
2>Class template argument deduction for aggregates
</td>
812 <td><a href=
"https://wg21.link/p1816r0">P1816R0
</a></td>
813 <td rowspan=
2 class=
"full" align=
"center">Clang
17</td>
815 <tr> <!-- from Prague -->
816 <td><a href=
"https://wg21.link/p2082r1">P2082R1
</a></td>
819 <td>Class template argument deduction for alias templates
</td>
820 <td><a href=
"https://wg21.link/p1814r0">P1814R0
</a></td>
821 <td class=
"none" align=
"center">No
</td>
824 <td>Permit conversions to arrays of unknown bound
</td>
825 <td><a href=
"https://wg21.link/p0388r4">P0388R4
</a></td>
826 <td class=
"full" align=
"center">Clang
14</td>
829 <td><tt>constinit
</tt></td>
830 <td><a href=
"https://wg21.link/p1143r2">P1143R2
</a></td>
831 <td class=
"full" align=
"center">Clang
10</td>
833 <!-- Prague 2019 papers -->
835 <td>Pseudo-destructors end object lifetimes
</td>
836 <td><a href=
"https://wg21.link/p0593r6">P0593R6
</a> (
<a href=
"#dr">DR
</a>)
</td>
837 <td class=
"full" align=
"center">Clang
11</td>
840 <td>More implicit moves
</td>
841 <td><a href=
"https://wg21.link/p1825r0">P1825R0
</a> (
<a href=
"#dr">DR
</a>)
</td>
842 <td class=
"full" align=
"center">Clang
13</td>
847 <span id=
"p0482">(
11): Prior to Clang
8, this feature is not enabled by
848 <tt>-std=c++
20</tt>, but can be enabled with
<tt>-fchar8_t
</tt>.
854 <h2 id=
"cxx17">C++
17 implementation status
</h2>
856 <p>Clang
5 and later implement all the features of the
857 <a href=
"https://www.iso.org/standard/68564.html">ISO C++
2017 standard
</a>.
</p>
859 <p>By default, Clang
16 or later builds C++ code according to the C++
17 standard.
860 You can use Clang in C++
17 mode with the
<code>-std=c++
17</code> option
861 (use
<code>-std=c++
1z
</code> in Clang
4 and earlier).
</p>
864 <summary>List of features and minimum Clang version with support
</summary>
866 <table width=
"689" border=
"1" cellspacing=
"0">
868 <th>Language Feature
</th>
869 <th>C++
17 Proposal
</th>
870 <th>Available in Clang?
</th>
872 <!-- Issaquah 2014 papers -->
874 <td><tt>static_assert
</tt> with no message
</td>
875 <td><a href=
"https://wg21.link/n3928">N3928
</a></td>
876 <td class=
"full" align=
"center">Clang
3.5</td>
878 <!-- Rapperswil papers -->
880 <td>Disabling trigraph expansion by default
</td>
881 <td><a href=
"https://wg21.link/n4086">N4086
</a></td>
882 <td class=
"full" align=
"center">Clang
3.5</td>
885 <td><tt>typename
</tt> in a template template parameter
</td>
886 <td><a href=
"https://wg21.link/n4051">N4051
</a></td>
887 <td class=
"full" align=
"center">Clang
3.5</td>
890 <td>New
<tt>auto
</tt> rules for direct-list-initialization
891 <td><a href=
"https://wg21.link/n3922">N3922
</a></td>
892 <td class=
"full" align=
"center">Clang
3.8 <a href=
"#n3922">(
8)
</a></td>
894 <!-- Urbana papers -->
896 <td rowspan=
"2">Fold expressions
</td>
897 <td><a href=
"https://wg21.link/n4295">N4295
</a></td>
898 <td class=
"full" align=
"center">Clang
3.6</td>
900 <tr> <!-- from Jacksonville -->
901 <td><a href=
"https://wg21.link/p0036r0">P0036R0
</a></td>
902 <td class=
"full" align=
"center">Clang
3.9</td>
905 <td><tt>u8
</tt> character literals
</td>
906 <td><a href=
"https://wg21.link/n4267">N4267
</a></td>
907 <td class=
"full" align=
"center">Clang
3.6</td>
910 <td>Nested namespace definition
</td>
911 <td><a href=
"https://wg21.link/n4230">N4230
</a></td>
912 <td class=
"full" align=
"center">Clang
3.6</td>
915 <td>Attributes for namespaces and enumerators
</td>
916 <td><a href=
"https://wg21.link/n4266">N4266
</a></td>
917 <td class=
"full" align=
"center">Clang
3.6</td>
920 <td>Allow constant evaluation for all non-type template arguments
</td>
921 <td><a href=
"https://wg21.link/n4268">N4268
</a></td>
922 <td class=
"full" align=
"center">Clang
3.6</td>
926 <td>Remove deprecated
<tt>register
</tt> storage class
</td>
927 <td><a href=
"https://wg21.link/p0001r1">P0001R1
</a></td>
928 <td class=
"full" align=
"center">Clang
3.8</td>
931 <td>Remove deprecated
<tt>bool
</tt> increment
</td>
932 <td><a href=
"https://wg21.link/p0002r1">P0002R1
</a></td>
933 <td class=
"full" align=
"center">Clang
3.8</td>
936 <td>Make exception specifications part of the type system
</td>
937 <td><a href=
"https://wg21.link/p0012r1">P0012R1
</a></td>
938 <td class=
"full" align=
"center">Clang
4</td>
941 <td><tt>__has_include
</tt> in preprocessor conditionals
</td>
942 <td><a href=
"https://wg21.link/p0061r1">P0061R1
</a></td>
943 <td class=
"full" align=
"center">Yes
</td>
945 <!-- Jacksonville papers -->
947 <td><tt>[[fallthrough]]
</tt> attribute
</td>
948 <td><a href=
"https://wg21.link/p0188r1">P0188R1
</a></td>
949 <td class=
"full" align=
"center">Clang
3.9</td>
952 <td rowspan=
"2"><tt>[[nodiscard]]
</tt> attribute
</td>
953 <td><a href=
"https://wg21.link/p0189r1">P0189R1
</a></td>
954 <td class=
"full" align=
"center">Clang
3.9</td>
956 <tr> <!-- from Cologne 2019 -->
957 <td><a href=
"https://wg21.link/p1771r1">P1771R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
958 <td class=
"full" align=
"center">Clang
9</td>
961 <td><tt>[[maybe_unused]]
</tt> attribute
</td>
962 <td><a href=
"https://wg21.link/p0212r1">P0212R1
</a></td>
963 <td class=
"full" align=
"center">Clang
3.9</td>
966 <td>Aggregate initialization of classes with base classes
</td>
967 <td><a href=
"https://wg21.link/p0017r1">P0017R1
</a></td>
968 <td class=
"full" align=
"center">Clang
3.9</td>
971 <td><tt>constexpr
</tt> lambda expressions
</td>
972 <td><a href=
"https://wg21.link/p0170r1">P0170R1
</a></td>
973 <td class=
"full" align=
"center">Clang
5</td>
976 <td>Differing
<tt>begin
</tt> and
<tt>end
</tt> types in range-based
<tt>for
</tt></td>
977 <td><a href=
"https://wg21.link/p0184r0">P0184R0
</a></td>
978 <td class=
"full" align=
"center">Clang
3.9</td>
981 <td>Lambda capture of
<tt>*this
</tt></td>
982 <td><a href=
"https://wg21.link/p0018r3">P0018R3
</a></td>
983 <td class=
"full" align=
"center">Clang
3.9</td>
986 <td>Direct-list-initialization of
<tt>enum
</tt>s
</td>
987 <td><a href=
"https://wg21.link/p0138r2">P0138R2
</a></td>
988 <td class=
"full" align=
"center">Clang
3.9</td>
991 <td>Hexadecimal floating-point literals
</td>
992 <td><a href=
"https://wg21.link/p0245r1">P0245R1
</a></td>
993 <td class=
"full" align=
"center">Yes
</td>
997 <td>Using attribute namespaces without repetition
</td>
998 <td><a href=
"https://wg21.link/p0028r4">P0028R4
</a></td>
999 <td class=
"full" align=
"center">Clang
3.9</td>
1002 <td>Dynamic memory allocation for over-aligned data
</td>
1003 <td><a href=
"https://wg21.link/p0035r4">P0035R4
</a></td>
1004 <td class=
"full" align=
"center">Clang
4</td>
1007 <td rowspan=
"4">Template argument deduction for class templates
</td>
1008 <td><a href=
"https://wg21.link/p0091r3">P0091R3
</a></td>
1009 <td rowspan=
"2" class=
"full" align=
"center">Clang
5</td>
1011 <tr> <!-- from Issaquah -->
1012 <td><a href=
"https://wg21.link/p0512r0">P0512R0
</a></td>
1015 <!-- from Kona 2017 -->
1016 <td><a href=
"https://wg21.link/p0620r1">P0620R0
</a> (
<a href=
"#dr">DR
</a>)
</td>
1017 <td class=
"full" align=
"center">Clang
7</td>
1020 <!-- from Toronto 2017 -->
1021 <td><a href=
"https://wg21.link/p0702r1">P0702R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
1022 <td class=
"full" align=
"center">Clang
6</td>
1025 <td>Non-type template parameters with
<tt>auto
</tt> type
</td>
1026 <td><a href=
"https://wg21.link/p0127r2">P0127R2
</a></td>
1027 <td class=
"full" align=
"center">Clang
4</td>
1030 <td>Guaranteed copy elision
</td>
1031 <td><a href=
"https://wg21.link/p0135r1">P0135R1
</a></td>
1032 <td class=
"full" align=
"center">Clang
4</td>
1035 <td rowspan=
2>Stricter expression evaluation order
</td>
1036 <td><a href=
"https://wg21.link/p0145r3">P0145R3
</a></td>
1037 <td class=
"full" align=
"center" rowspan=
2>Clang
4 <a href=
"#p0145">(
9)
</a></td>
1040 <td><a href=
"https://wg21.link/p0400r0">P0400R0
</a></td>
1043 <td>Requirement to ignore unknown attributes
</td>
1044 <td><a href=
"https://wg21.link/p0283r2">P0283R2
</a></td>
1045 <td class=
"full" align=
"center">Yes
</td>
1048 <td><tt>constexpr
</tt> <em>if-statement
</em>s
</td>
1049 <td><a href=
"https://wg21.link/p0292r2">P0292R2
</a></td>
1050 <td class=
"full" align=
"center">Clang
3.9</td>
1053 <td>Inline variables
</td>
1054 <td><a href=
"https://wg21.link/p0386r2">P0386R2
</a></td>
1055 <td class=
"full" align=
"center">Clang
3.9</td>
1058 <td rowspan=
"3">Structured bindings
</td>
1059 <td><a href=
"https://wg21.link/p0217r3">P0217R3
</a></td>
1060 <td class=
"full" align=
"center">Clang
4</td>
1063 <!-- from Jacksonville 2018 -->
1064 <td><a href=
"https://wg21.link/p0961r1">P0961R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
1065 <td class=
"full" align=
"center">Clang
8</td>
1068 <!-- from Jacksonville 2018 -->
1069 <td><a href=
"https://wg21.link/p0969r0">P0969R0
</a> (
<a href=
"#dr">DR
</a>)
</td>
1070 <td class=
"full" align=
"center">Clang
8</td>
1073 <td>Separate variable and condition for
<tt>if
</tt> and
<tt>switch
</tt></td>
1074 <td><a href=
"https://wg21.link/p0305r1">P0305R1
</a></td>
1075 <td class=
"full" align=
"center">Clang
3.9</td>
1077 <!-- Issaquah 2016 papers -->
1079 <td>Matching template template parameters to compatible arguments
</td>
1080 <td><a href=
"https://wg21.link/p0522r0">P0522R0
</a></td>
1081 <td class=
"partial" align=
"center">Partial
<a href=
"#p0522">(
10)
</a></td>
1084 <td>Removing deprecated dynamic exception specifications
</td>
1085 <td><a href=
"https://wg21.link/p0003r5">P0003R5
</a></td>
1086 <td class=
"full" align=
"center">Clang
4</td>
1089 <td>Pack expansions in
<em>using-declarations
</em></td>
1090 <td><a href=
"https://wg21.link/p0195r2">P0195R2
</a></td>
1091 <td class=
"full" align=
"center">Clang
4</td>
1096 <span id=
"n3922">(
8): This is a backwards-incompatible change that is applied to
1097 all language versions that allow type deduction from
<tt>auto
</tt>
1098 (per the request of the C++ committee).
1099 In Clang
3.7, a warning is emitted for all cases that would change meaning.
1101 <span id=
"p0145">(
9): Under the MS ABI, function parameters are destroyed from
1102 left to right in the callee. As a result, function parameters in calls to
1103 <tt>operator
<<</tt>,
<tt>operator
>></tt>,
<tt>operator-
>*
</tt>,
1104 <tt>operator
&&</tt>,
<tt>operator||
</tt>, and
<tt>operator,
</tt>
1105 functions using expression syntax are no longer guaranteed to be destroyed in
1106 reverse construction order in that ABI.
1107 This is not fully supported during constant expression evaluation until Clang
12.
1109 <span id=
"p0522">(
10): Despite being the resolution to a Defect Report, this
1110 feature is disabled by default in all language versions, and can be enabled
1111 explicitly with the flag
<tt>-frelaxed-template-template-args
</tt> in Clang
4
1113 The change to the standard lacks a corresponding change for template partial
1114 ordering, resulting in ambiguity errors for reasonable and previously-valid
1115 code. This issue is expected to be rectified soon.
1120 <h2 id=
"cxx14">C++
14 implementation status
</h2>
1122 <p>Clang
3.4 and later implement all of the
<a
1123 href=
"https://www.iso.org/standard/64029.html">ISO
1124 C++
2014 standard
</a>.
</p>
1126 <p>You can use Clang in C++
14 mode with the
<code>-std=c++
14</code> option
1127 (use
<code>-std=c++
1y
</code> in Clang
3.4 and earlier).
</p>
1130 <summary>List of features and minimum Clang version with support
</summary>
1132 <table width=
"689" border=
"1" cellspacing=
"0">
1134 <th>Language Feature
</th>
1135 <th>C++
14 Proposal
</th>
1136 <th>Available in Clang?
</th>
1139 <td>Tweak to certain C++ contextual conversions
</td>
1140 <td><a href=
"https://wg21.link/n3323">N3323
</a></td>
1141 <td class=
"full" align=
"center">Clang
3.4</td>
1144 <td>Binary literals
</td>
1145 <td><a href=
"https://wg21.link/n3472">N3472
</a></td>
1146 <td class=
"full" align=
"center">Clang
2.9</td>
1149 <td>decltype(auto)
</td>
1150 <td rowspan=
2 style=
"vertical-align:middle"><a href=
"https://wg21.link/n3638">N3638
</a></td>
1151 <td class=
"full" align=
"center">Clang
3.3</td>
1154 <td>Return type deduction for normal functions
</td>
1155 <td class=
"full" align=
"center">Clang
3.4</td>
1158 <td>Initialized lambda captures
</td>
1159 <td><a href=
"https://wg21.link/n3648">N3648
</a></td>
1160 <td class=
"full" align=
"center">Clang
3.4</td>
1163 <td>Generic lambdas
</td>
1164 <td><a href=
"https://wg21.link/n3649">N3649
</a></td>
1165 <td class=
"full" align=
"center">Clang
3.4</td>
1168 <td>Variable templates
</td>
1169 <td><a href=
"https://wg21.link/n3651">N3651
</a></td>
1170 <td class=
"full" align=
"center">Clang
3.4</td>
1173 <td>Relaxing requirements on constexpr functions
</td>
1174 <td><a href=
"https://wg21.link/n3652">N3652
</a></td>
1175 <td class=
"full" align=
"center">Clang
3.4</td>
1178 <td>Member initializers and aggregates
</td>
1179 <td><a href=
"https://wg21.link/n3653">N3653
</a></td>
1180 <td class=
"full" align=
"center">Clang
3.3</td>
1183 <td>Clarifying memory allocation
</td>
1184 <td><a href=
"https://wg21.link/n3664">N3664
</a></td>
1185 <td class=
"full" align=
"center">Clang
3.4</td>
1188 <td><tt>[[deprecated]]
</tt> attribute
</td>
1189 <td><a href=
"https://wg21.link/n3760">N3760
</a></td>
1190 <td class=
"full" align=
"center">Clang
3.4</td>
1193 <td>Single quotation mark as digit separator
</td>
1194 <td><a href=
"https://wg21.link/n3781">N3781
</a></td>
1195 <td class=
"full" align=
"center">Clang
3.4</td>
1198 <td>C++ Sized Deallocation
</td>
1199 <td><a href=
"https://wg21.link/n3778">N3778
</a></td>
1200 <td class=
"full" align=
"center">Clang
3.4 <a href=
"#n3778">(
7)
</a></td>
1205 <span id=
"n3778">(
7): In Clang
3.7 and later, sized deallocation is only enabled
1206 if the user passes the
<code>-fsized-deallocation
</code> flag. The user must
1207 supply definitions of the sized deallocation functions, either by providing them
1208 explicitly or by using a C++ standard library that does.
<code>libstdc++
</code>
1209 added these functions in version
5.0, and
<code>libc++
</code> added them in
1215 <h2 id=
"cxx11">C++
11 implementation status
</h2>
1217 <p>Clang
3.3 and later implement all of the
<a
1218 href=
"https://www.iso.org/standard/50372.html">ISO
1219 C++
2011 standard
</a>.
</p>
1221 <p>You can use Clang in C++
11 mode with the
<code>-std=c++
11</code>
1222 option. Clang's C++
11 mode can be used with
1223 <a href=
"https://libcxx.llvm.org/">libc++
</a> or with gcc's libstdc++.
</p>
1226 <summary>List of features and minimum Clang version with support
</summary>
1228 <table width=
"689" border=
"1" cellspacing=
"0">
1230 <th>Language Feature
</th>
1231 <th>C++
11 Proposal
</th>
1232 <th>Available in Clang?
</th>
1235 <td rowspan=
"2">Rvalue references
</td>
1236 <td><a href=
"https://wg21.link/n2118">N2118
</a></td>
1237 <td class=
"full" align=
"center">Clang
2.9</td>
1238 <tr> <!-- from Kona 2019-->
1239 <td><a href=
"https://wg21.link/p1825r0">P1825R0
</a> (
<a href=
"#dr">DR
</a>)
</td>
1240 <td class=
"full" align=
"center">Clang
13</td>
1244 <td> Rvalue references for
<code>*this
</code></td>
1245 <td><a href=
"https://wg21.link/n2439">N2439
</a></td>
1246 <td class=
"full" align=
"center">Clang
2.9</td>
1249 <td>Initialization of class objects by rvalues
</td>
1250 <td><a href=
"https://wg21.link/n1610">N1610
</a></td>
1251 <td class=
"full" align=
"center">Clang
2.9</td>
1254 <td>Non-static data member initializers
</td>
1255 <td><a href=
"https://wg21.link/n2756">N2756
</a></td>
1256 <td class=
"full" align=
"center">Clang
3.0</td>
1259 <td>Variadic templates
</td>
1260 <td><a href=
"https://wg21.link/n2242">N2242
</a></td>
1261 <td class=
"full" align=
"center">Clang
2.9</td>
1264 <td> Extending variadic template template parameters
</td>
1265 <td><a href=
"https://wg21.link/n2555">N2555
</a></td>
1266 <td class=
"full" align=
"center">Clang
2.9</td>
1269 <td rowspan=
"3">Initializer lists
</td>
1270 <td><a href=
"https://wg21.link/n2672">N2672
</a></td>
1271 <td class=
"full" align=
"center">Clang
3.1</td>
1273 <tr> <!-- from Kona 2019-->
1274 <td><a href=
"https://wg21.link/p1009r2">P1009R2
</a> (
<a href=
"#dr">DR
</a>)
</td>
1275 <td class=
"full" align=
"center">Clang
9</td>
1277 <tr> <!-- from Prague-->
1278 <td><a href=
"https://wg21.link/p1957r2">P1957R2
</a> (
<a href=
"#dr">DR
</a>)
</td>
1279 <td class=
"full" align=
"center">Clang
11</td>
1282 <td>Static assertions
</td>
1283 <td><a href=
"https://wg21.link/n1720">N1720
</a></td>
1284 <td class=
"full" align=
"center">Clang
2.9</td>
1287 <td><code>auto
</code>-typed variables
</td>
1288 <td><a href=
"https://wg21.link/n1984">N1984
</a></td>
1289 <td class=
"full" align=
"center">Clang
2.9</td>
1292 <td> Multi-declarator
<code>auto
</code></td>
1293 <td><a href=
"https://wg21.link/n1737">N1737
</a></td>
1294 <td class=
"full" align=
"center">Clang
2.9</td>
1297 <td> Removal of auto as a storage-class specifier
</td>
1298 <td><a href=
"https://wg21.link/n2546">N2546
</a></td>
1299 <td class=
"full" align=
"center">Clang
2.9</td>
1302 <td> New function declarator syntax
</td>
1303 <td><a href=
"https://wg21.link/n2541">N2541
</a></td>
1304 <td class=
"full" align=
"center">Clang
2.9</td>
1307 <td rowspan=
"2">Lambda expressions
</td>
1308 <td><a href=
"https://wg21.link/n2927">N2927
</a></td>
1309 <td class=
"full" align=
"center">Clang
3.1</td>
1312 <!-- from Albuquerque 2017 -->
1313 <td><a href=
"https://wg21.link/p0588r1">P0588R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
1314 <td class=
"none" align=
"center">No
</td>
1317 <td>Declared type of an expression
</td>
1318 <td><a href=
"https://wg21.link/n2343">N2343
</a></td>
1319 <td class=
"full" align=
"center">Clang
2.9</td>
1322 <td> Incomplete return types
</td>
1323 <td><a href=
"https://wg21.link/n3276">N3276
</a></td>
1324 <td class=
"full" align=
"center">Clang
3.1</td>
1327 <td>Right angle brackets
</td>
1328 <td><a href=
"https://wg21.link/n1757">N1757
</a></td>
1329 <td class=
"full" align=
"center">Clang
2.9</td>
1332 <td>Default template arguments for function templates
</td>
1333 <td><a href=
"https://wg21.link/cwg226">DR226
</a></td>
1334 <td class=
"full" align=
"center">Clang
2.9</td>
1337 <td>Solving the SFINAE problem for expressions
</td>
1338 <td><a href=
"https://wg21.link/n2634">DR339
</a></td>
1339 <td class=
"full" align=
"center">Clang
2.9</td>
1342 <td>Alias templates
</td>
1343 <td><a href=
"https://wg21.link/n2258">N2258
</a></td>
1344 <td class=
"full" align=
"center">Clang
3.0</td>
1347 <td>Extern templates
</td>
1348 <td><a href=
"https://wg21.link/n1987">N1987
</a></td>
1349 <td class=
"full" align=
"center">Clang
2.9</td>
1352 <td>Null pointer constant
</td>
1353 <td><a href=
"https://wg21.link/n2431">N2431
</a></td>
1354 <td class=
"full" align=
"center">Clang
3.0</td>
1357 <td>Strongly-typed enums
</td>
1358 <td><a href=
"https://wg21.link/n2347">N2347
</a></td>
1359 <td class=
"full" align=
"center">Clang
2.9</td>
1362 <td>Forward declarations for enums
</td>
1363 <td><a href=
"https://wg21.link/n2764">N2764
</a>
1364 <br><a href=
"https://wg21.link/cwg1206">DR1206
</a></td>
1365 <td class=
"full" align=
"center">Clang
3.1</td>
1368 <td>Standardized attribute syntax
</td>
1369 <td><a href=
"https://wg21.link/n2761">N2761
</a></td>
1370 <td class=
"full" align=
"center">Clang
3.3 <a href=
"#n2761">(
1)
</a></td>
1373 <td rowspan=
"2">Generalized constant expressions
</td>
1374 <td><a href=
"https://wg21.link/n2235">N2235
</a></td>
1375 <td class=
"full" align=
"center">Clang
3.1</td>
1378 <!-- from Albuquerque 2017 -->
1379 <td><a href=
"https://wg21.link/p0859r0">P0859R0
</a> (
<a href=
"#dr">DR
</a>)
</td>
1380 <td class=
"full" align=
"center">Clang
8</td>
1383 <td>Alignment support
</td>
1384 <td><a href=
"https://wg21.link/n2341">N2341
</a></td>
1385 <td class=
"full" align=
"center">Clang
3.3</td>
1388 <td>Conditionally-support behavior
</td>
1389 <td><a href=
"https://wg21.link/n1627">N1627
</a></td>
1390 <td class=
"full" align=
"center">Clang
2.9</td>
1393 <td>Changing undefined behavior into diagnosable errors
</td>
1394 <td><a href=
"https://wg21.link/n1727">N1727
</a></td>
1395 <td class=
"full" align=
"center">Clang
2.9</td>
1398 <td>Delegating constructors
</td>
1399 <td><a href=
"https://wg21.link/n1986">N1986
</a></td>
1400 <td class=
"full" align=
"center">Clang
3.0</td>
1403 <td rowspan=
"2">Inheriting constructors
</td>
1404 <td><a href=
"https://wg21.link/n2540">N2540
</a></td>
1405 <td class=
"full" align=
"center">Clang
3.3</td>
1408 <!-- from Kona 2015 -->
1409 <td><a href=
"https://wg21.link/p0136r1">P0136R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
1410 <td class=
"full" align=
"center">Clang
3.9</td>
1413 <td>Explicit conversion operators
</td>
1414 <td><a href=
"https://wg21.link/n2437">N2437
</a></td>
1415 <td class=
"full" align=
"center">Clang
3.0</td>
1418 <td>New character types
</td>
1419 <td><a href=
"https://wg21.link/n2249">N2249
</a></td>
1420 <td class=
"full" align=
"center">Clang
2.9</td>
1423 <td>Unicode string literals
</td>
1424 <td><a href=
"https://wg21.link/n2442">N2442
</a></td>
1425 <td class=
"full" align=
"center">Clang
3.0</td>
1428 <td>Raw string literals
</td>
1429 <td><a href=
"https://wg21.link/n2442">N2442
</a></td>
1430 <td class=
"full" align=
"center">Clang
3.0</td>
1433 <td>Universal character names in literals
</td>
1434 <td><a href=
"https://wg21.link/n2170">N2170
</a></td>
1435 <td class=
"full" align=
"center">Clang
3.1</td>
1438 <td>User-defined literals
</td>
1439 <td><a href=
"https://wg21.link/n2765">N2765
</a></td>
1440 <td class=
"full" align=
"center">Clang
3.1</td>
1443 <td>Standard Layout Types
</td>
1444 <td><a href=
"https://wg21.link/n2342">N2342
</a></td>
1445 <td class=
"full" align=
"center">Clang
3.0</td>
1448 <td rowspan=
"2">Defaulted functions
</td>
1449 <td><a href=
"https://wg21.link/n2346">N2346
</a></td>
1450 <td class=
"full" align=
"center">Clang
3.0</td>
1452 <tr> <!-- from Kona 2019-->
1453 <td><a href=
"https://wg21.link/p1286r2">P1286R2
</a> (
<a href=
"#dr">DR
</a>)
</td>
1454 <td class=
"full" align=
"center">Clang
9</td>
1457 <td>Deleted functions
</td>
1458 <td><a href=
"https://wg21.link/n2346">N2346
</a></td>
1459 <td class=
"full" align=
"center">Clang
2.9</td>
1462 <td>Extended friend declarations
</td>
1463 <td><a href=
"https://wg21.link/n1791">N1791
</a></td>
1464 <td class=
"full" align=
"center">Clang
2.9</td>
1467 <td>Extending
<code>sizeof
</code></td>
1468 <td><a href=
"https://wg21.link/n2253">N2253
</a>
1469 <br><a href=
"https://wg21.link/cwg850">DR850
</a></td>
1470 <td class=
"full" align=
"center">Clang
3.1</td>
1473 <td>Inline namespaces
</td>
1474 <td><a href=
"https://wg21.link/n2535">N2535
</a></td>
1475 <td class=
"full" align=
"center">Clang
2.9</td>
1478 <td>Unrestricted unions
</td>
1479 <td><a href=
"https://wg21.link/n2544">N2544
</a></td>
1480 <td class=
"full" align=
"center">Clang
3.1</td>
1483 <td>Local and unnamed types as template arguments
</td>
1484 <td><a href=
"https://wg21.link/n2657">N2657
</a></td>
1485 <td class=
"full" align=
"center">Clang
2.9</td>
1488 <td rowspan=
"2">Range-based for
</td>
1489 <td><a href=
"https://wg21.link/n2930">N2930
</a></td>
1490 <td class=
"full" align=
"center">Clang
3.0</td>
1493 <!-- from Jacksonville 2018 -->
1494 <td><a href=
"https://wg21.link/p0962r1">P0962R1
</a> (
<a href=
"#dr">DR
</a>)
</td>
1495 <td class=
"full" align=
"center">Clang
8</td>
1498 <td>Explicit virtual overrides
</td>
1499 <td><a href=
"https://wg21.link/n2928">N2928
</a>
1500 <br><a href=
"https://wg21.link/n3206">N3206
</a>
1501 <br><a href=
"https://wg21.link/n3272">N3272
</a></td>
1502 <td class=
"full" align=
"center">Clang
3.0</td>
1505 <td>Minimal support for garbage collection and reachability-based leak detection
</td>
1506 <td><a href=
"https://wg21.link/n2670">N2670
</a></td>
1507 <td class=
"na" align=
"center">N/A
<a href=
"#n2670">(
2)
</a></td>
1510 <td>Allowing move constructors to throw [noexcept]
</td>
1511 <td><a href=
"https://wg21.link/n3050">N3050
</a></td>
1512 <td class=
"full" align=
"center">Clang
3.0</td>
1515 <td>Defining move special member functions
</td>
1516 <td><a href=
"https://wg21.link/n3053">N3053
</a></td>
1517 <td class=
"full" align=
"center">Clang
3.0</td>
1520 <tr class=
"separator">
1521 <th align=
"center" colspan=
"3">Concurrency
</th>
1524 <td>Sequence points
</td>
1525 <td><a href=
"https://wg21.link/n2239">N2239
</a></td>
1526 <td class=
"full" align=
"center">Clang
3.3</td>
1529 <td>Atomic operations
</td>
1530 <td><a href=
"https://wg21.link/n2427">N2427
</a></td>
1531 <td class=
"full" align=
"center">Clang
3.1</td>
1534 <td>Strong Compare and Exchange
</td>
1535 <td><a href=
"https://wg21.link/n2748">N2748
</a></td>
1536 <td class=
"full" align=
"center">Clang
3.1 <a href=
"#n2748">(
3)
</a></td>
1539 <td>Bidirectional Fences
</td>
1540 <td><a href=
"https://wg21.link/n2752">N2752
</a></td>
1541 <td class=
"full" align=
"center">Clang
3.1</td>
1545 <td>Memory model
</td>
1546 <td><a href=
"https://wg21.link/n2429">N2429
</a></td>
1547 <td class=
"full" align=
"center">Clang
3.2</td>
1550 <td>Data-dependency ordering: atomics and memory model
</td>
1551 <td><a href=
"https://wg21.link/n2664">N2664
</a></td>
1552 <td class=
"full" align=
"center">Clang
3.2 <a href=
"#n2664">(
4)
</a></td>
1555 <td>Propagating exceptions
</td>
1556 <td><a href=
"https://wg21.link/n2179">N2179
</a></td>
1557 <td class=
"full" align=
"center">Clang
2.9</td>
1560 <td>Allow atomics use in signal handlers
</td>
1561 <td><a href=
"https://wg21.link/n2547">N2547
</a></td>
1562 <td class=
"full" align=
"center">Clang
3.1</td>
1565 <td>Thread-local storage
</td>
1566 <td><a href=
"https://wg21.link/n2659">N2659
</a></td>
1567 <td class=
"full" align=
"center">Clang
3.3 <a href=
"#n2659">(
5)
</a></td>
1570 <td>Dynamic initialization and destruction with concurrency
</td>
1571 <td><a href=
"https://wg21.link/n2660">N2660
</a></td>
1572 <td class=
"full" align=
"center">Clang
2.9</td>
1575 <tr class=
"separator">
1576 <th align=
"center" colspan=
"3">C99 Features in C++
11</th>
1579 <td><code>__func__
</code> predefined identifier
</td>
1580 <td><a href=
"https://wg21.link/n2340">N2340
</a></td>
1581 <td class=
"full" align=
"center">Clang
2.9</td>
1584 <td>C99 preprocessor
</td>
1585 <td><a href=
"https://wg21.link/n1653">N1653
</a></td>
1586 <td class=
"full" align=
"center">Clang
2.9</td>
1589 <td><code>long long
</code></td>
1590 <td><a href=
"https://wg21.link/n1811">N1811
</a></td>
1591 <td class=
"full" align=
"center">Clang
2.9</td>
1594 <td>Extended integral types
</td>
1595 <td><a href=
"https://wg21.link/n1988">N1988
</a></td>
1596 <td class=
"na" align=
"center">N/A
<a href=
"#n1988">(
6)
</a></td>
1601 <span id=
"n2761">(
1): The
<code>[[carries_dependency]]
</code> attribute
1602 has no effect.
</span><br>
1603 <span id=
"n2670">(
2): No compiler changes are required for an implementation
1604 such as Clang that does not provide garbage collection.
</span><br>
1605 <span id=
"n2748">(
3): All compare-exchange operations are emitted as
1606 strong compare-exchanges.
</span><br>
1607 <span id=
"n2664">(
4):
<code>memory_order_consume
</code> is lowered to
1608 <code>memory_order_acquire
</code>.
</span><br>
1609 <span id=
"n2659">(
5):
<code>thread_local
</code> support
1610 requires a C++ runtime library providing
<code>__cxa_thread_atexit
</code>, such
1611 as
<a href=
"https://libcxxabi.llvm.org">libc++abi
</a> 3.6 or later,
1612 or libsupc++
4.8 or later.
</span><br>
1613 <span id=
"n1988">(
6): No compiler changes are required for an implementation
1614 such as Clang that does not provide any extended integer types.
1615 <code>__int128
</code> is not treated as an extended integer type,
1616 because changing
<code>intmax_t
</code> would be an ABI-incompatible
1622 <h2 id=
"cxx98">C++
98 implementation status
</h2>
1624 <p>Clang implements all of the ISO C++
1998 standard
1625 (including the defects addressed in the ISO C++
2003 standard)
1626 except for
<tt>export
</tt> (which was removed in C++
11).
1628 <h2 id=
"dr">Defect reports
</h2>
1630 <p>Clang generally aims to implement resolutions to Defect Reports (bug fixes
1631 against prior standards) retroactively, in all prior standard versions where
1632 the fix is meaningful. Significant Defect Report changes to language features
1633 after the publication of the relevant standard are marked (DR) in the above
1636 <p>Clang also has a test suite for conformance to resolutions for issues on the
1637 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_toc.html">C++ core issues list
</a>,
1638 most of which are considered Defect Reports.
1639 <a href=
"cxx_dr_status.html">Implementation status for C++ core issues
</a> based on
1640 that test suite is tracked on a separate page.
</p>
1642 <h2 id=
"ts">Technical specifications and standing documents
</h2>
1644 <p>ISO C++ also publishes a number of documents describing additional language
1645 and library features that are not part of standard C++.
</p>
1648 <summary>List of features and minimum Clang version with support
</summary>
1650 <table width=
"689" border=
"1" cellspacing=
"0">
1653 <th>Latest draft
</th>
1654 <th>Compiler flag
</th>
1655 <th>Available in Clang?
</th>
1658 <td rowspan=
"7">SD-
6: SG10 feature test recommendations
</td>
1659 <td rowspan=
"7"><a href=
"https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations">SD-
6</a></td>
1660 <td rowspan=
"7">N/A
</td>
1661 <td class=
"full" align=
"center">
1662 Clang
3.4 (
<a href=
"https://wg21.link/n3745">N3745
</a>)
</br>
1666 <td class=
"full" align=
"center">
1667 Clang
3.6 (
<a href=
"https://wg21.link/n4200">N4200
</a>)
</a>
1671 <td class=
"full" align=
"center">
1672 Clang
4 (
<a href=
"https://wg21.link/p0096r3">P0096R3
</a>)
</a>
1676 <td class=
"full" align=
"center">
1677 Clang
5 (
<a href=
"https://wg21.link/p0096r4">P0096R4
</a>)
</a>
1681 <td class=
"full" align=
"center">
1682 Clang
7 (
<a href=
"https://wg21.link/p0096r5">P0096R5
</a>)
</a>
1686 <td class=
"full" align=
"center">
1687 Clang
9 (
<a href=
"https://wg21.link/p1353r0">P1353R0
</a>)
1691 <td class=
"full" align=
"center">
1692 Clang
10 (
<a href=
"https://wg21.link/p1902r1">P1902R1
</a>)
</a>
1695 <!-- No compiler support is known to be needed for:
1697 * Parallelism TS (v1, v2)
1703 <td>[TS] Concepts
</td>
1704 <td><a href=
"https://wg21.link/p0121r0">P0121R0
</a></td>
1706 <td class=
"na" align=
"center">Superseded by
<a href=
"#p0734">P0734R0
</a></td>
1709 <!-- track unimplemented Coroutines features: p0913r1 p0914r1 p1356r0 -->
1710 <td rowspan=
"2">[TS] Coroutines
</td>
1711 <td rowspan=
"2"><a href=
"https://isocpp.org/files/papers/N4663.pdf">N4663
</a></td>
1712 <td><tt>-fcoroutines-ts
<br>-stdlib=libc++
</tt></td>
1713 <td class=
"full" align=
"center">Clang
5</td>
1716 <td><tt>-std=c++
20<br>-stdlib=libc++
</tt></td>
1717 <td class=
"na" align=
"center">Superseded by
<a href=
"#p0912">P0912R5
</a></td>
1720 <td>[TS] Library Fundamentals, Version
1 (invocation type traits)
</td>
1721 <td><a href=
"https://wg21.link/n4480">N4480
</a></td>
1723 <td class=
"none" align=
"center">No
</td>
1726 <td>[TS] Library Fundamentals, Version
2 (
<tt>source_location
</tt>)
</td>
1727 <td><a href=
"https://wg21.link/n4617">N4617
</a></td>
1729 <td class=
"full" align=
"center">Clang
9 (
<a href=
"docs/LanguageExtensions.html#source-location-builtins">documentation
</a>)
</td>
1732 <td>[TS] Modules
</td>
1733 <td><a href=
"https://wg21.link/n4720">N4720
</a></td>
1734 <td><tt>-fmodules-ts
</tt></td>
1735 <td class=
"na" align=
"center">Superseded by
<a href=
"#p1103">P1103R3
</a></td>
1738 <td>[DRAFT TS] Reflection
</td>
1739 <td><a href=
"https://wg21.link/n4818">N4818
</a></td>
1741 <td class=
"none" align=
"center">No
</td>
1744 <td>[TS] Transactional Memory
</td>
1745 <td><a href=
"https://wg21.link/n4514">N4514
</a></td>
1747 <td class=
"none" align=
"center">No
</td>