[docs] Fix build-docs.sh
[llvm-project.git] / clang / www / cxx_status.html
blob06ad3868dd9d789cf0bb3ecfb3cd4e3f36b3e3dc
1 <!DOCTYPE html>
2 <html>
3 <head>
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 }
18 </style>
19 </head>
20 <body>
22 <!--#include virtual="menu.html.incl"-->
24 <div id="content">
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">
33 <tr>
34 <th>Language Standard</th>
35 <th>Flag</th>
36 <th>Available in Clang?</th>
37 </tr>
38 <tr>
39 <td><a href="#cxx98">C++98 / C++03</a></td>
40 <td><tt>-std=c++98</tt></td>
41 <td class="full" align="center">Yes (other than <tt>export</tt>)</td>
42 </tr>
43 <tr>
44 <td><a href="#cxx11">C++11</a></td>
45 <td><tt>-std=c++11</tt></td>
46 <td class="full" align="center">Clang 3.3</td>
47 </tr>
48 <tr>
49 <td><a href="#cxx14">C++14</a></td>
50 <td><tt>-std=c++14</tt></td>
51 <td class="full" align="center">Clang 3.4</td>
52 </tr>
53 <tr>
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>
57 </tr>
58 <tr>
59 <td><a href="#cxx20">C++20</a></td>
60 <td><tt>-std=c++20</tt></td>
61 <td class="partial" align="center">Partial</td>
62 </tr>
63 <tr>
64 <td><a href="#cxx23">C++2b (tentatively C++23)</a></td>
65 <td><tt>-std=c++2b</tt></td>
66 <td class="partial" align="center">Partial</td>
67 </tr>
68 </table>
70 <p>The Clang community is continually striving to improve C++ standards
71 compliance between releases by submitting and tracking <a
72 href="cxx_dr_status.html">C++ Defect Reports</a> and implementing resolutions
73 as they become available.</p>
75 <p>Experimental work is also under way to implement <a href="#ts">C++ Technical
76 Specifications</a> that will help drive the future of the C++ programming
77 language.</p>
79 <p>The <a href="https://github.com/llvm/llvm-project/issues/">LLVM bug tracker</a> uses
80 the "c++" label, as well as mode-specific labels such as "c++11", "c++14",
81 and so on, to track known bugs with Clang's language conformance.</p>
83 <h2 id="cxx98">C++98 implementation status</h2>
85 <p>Clang implements all of the ISO C++ 1998 standard
86 (including the defects addressed in the ISO C++ 2003 standard)
87 except for <tt>export</tt> (which was removed in C++11).
89 <h2 id="cxx11">C++11 implementation status</h2>
91 <p>Clang 3.3 and later implement all of the <a
92 href="https://www.iso.org/standard/50372.html">ISO
93 C++ 2011 standard</a>.</p>
95 <p>You can use Clang in C++11 mode with the <code>-std=c++11</code>
96 option. Clang's C++11 mode can be used with
97 <a href="https://libcxx.llvm.org/">libc++</a> or with gcc's libstdc++.</p>
99 <details>
100 <summary>List of features and minimum Clang version with support</summary>
102 <table width="689" border="1" cellspacing="0">
103 <tr>
104 <th>Language Feature</th>
105 <th>C++11 Proposal</th>
106 <th>Available in Clang?</th>
107 </tr>
108 <tr>
109 <td rowspan="2">Rvalue references</td>
110 <td><a href="https://wg21.link/n2118">N2118</a></td>
111 <td class="full" align="center">Clang 2.9</td>
112 <tr> <!-- from Kona 2019-->
113 <td><a href="https://wg21.link/p1825r0">P1825R0</a> (<a href="#dr">DR</a>)</td>
114 <td class="full" align="center">Clang 13</td>
115 </tr>
116 </tr>
117 <tr>
118 <td>&nbsp;&nbsp;&nbsp;&nbsp;Rvalue references for <code>*this</code></td>
119 <td><a href="https://wg21.link/n2439">N2439</a></td>
120 <td class="full" align="center">Clang 2.9</td>
121 </tr>
122 <tr>
123 <td>Initialization of class objects by rvalues</td>
124 <td><a href="https://wg21.link/n1610">N1610</a></td>
125 <td class="full" align="center">Clang 2.9</td>
126 </tr>
127 <tr>
128 <td>Non-static data member initializers</td>
129 <td><a href="https://wg21.link/n2756">N2756</a></td>
130 <td class="full" align="center">Clang 3.0</td>
131 </tr>
132 <tr>
133 <td>Variadic templates</td>
134 <td><a href="https://wg21.link/n2242">N2242</a></td>
135 <td class="full" align="center">Clang 2.9</td>
136 </tr>
137 <tr>
138 <td>&nbsp;&nbsp;&nbsp;&nbsp;Extending variadic template template parameters</td>
139 <td><a href="https://wg21.link/n2555">N2555</a></td>
140 <td class="full" align="center">Clang 2.9</td>
141 </tr>
142 <tr>
143 <td rowspan="3">Initializer lists</td>
144 <td><a href="https://wg21.link/n2672">N2672</a></td>
145 <td class="full" align="center">Clang 3.1</td>
146 </tr>
147 <tr> <!-- from Kona 2019-->
148 <td><a href="https://wg21.link/p1009r2">P1009R2</a> (<a href="#dr">DR</a>)</td>
149 <td class="full" align="center">Clang 9</td>
150 </tr>
151 <tr> <!-- from Prague-->
152 <td><a href="https://wg21.link/p1957r2">P1957R2</a> (<a href="#dr">DR</a>)</td>
153 <td class="full" align="center">Clang 11</td>
154 </tr>
155 <tr>
156 <td>Static assertions</td>
157 <td><a href="https://wg21.link/n1720">N1720</a></td>
158 <td class="full" align="center">Clang 2.9</td>
159 </tr>
160 <tr>
161 <td><code>auto</code>-typed variables</td>
162 <td><a href="https://wg21.link/n1984">N1984</a></td>
163 <td class="full" align="center">Clang 2.9</td>
164 </tr>
165 <tr>
166 <td>&nbsp;&nbsp;&nbsp;&nbsp;Multi-declarator <code>auto</code></td>
167 <td><a href="https://wg21.link/n1737">N1737</a></td>
168 <td class="full" align="center">Clang 2.9</td>
169 </tr>
170 <tr>
171 <td>&nbsp;&nbsp;&nbsp;&nbsp;Removal of auto as a storage-class specifier</td>
172 <td><a href="https://wg21.link/n2546">N2546</a></td>
173 <td class="full" align="center">Clang 2.9</td>
174 </tr>
175 <tr>
176 <td>&nbsp;&nbsp;&nbsp;&nbsp;New function declarator syntax</td>
177 <td><a href="https://wg21.link/n2541">N2541</a></td>
178 <td class="full" align="center">Clang 2.9</td>
179 </tr>
180 <tr>
181 <td rowspan="2">Lambda expressions</td>
182 <td><a href="https://wg21.link/n2927">N2927</a></td>
183 <td class="full" align="center">Clang 3.1</td>
184 </tr>
185 <tr>
186 <!-- from Albuquerque 2017 -->
187 <td><a href="https://wg21.link/p0588r1">P0588R1</a> (<a href="#dr">DR</a>)</td>
188 <td class="none" align="center">No</td>
189 </tr>
190 <tr>
191 <td>Declared type of an expression</td>
192 <td><a href="https://wg21.link/n2343">N2343</a></td>
193 <td class="full" align="center">Clang 2.9</td>
194 </tr>
195 <tr>
196 <td>&nbsp;&nbsp;&nbsp;&nbsp;Incomplete return types</td>
197 <td><a href="https://wg21.link/n3276">N3276</a></td>
198 <td class="full" align="center">Clang 3.1</td>
199 </tr>
200 <tr>
201 <td>Right angle brackets</td>
202 <td><a href="https://wg21.link/n1757">N1757</a></td>
203 <td class="full" align="center">Clang 2.9</td>
204 </tr>
205 <tr>
206 <td>Default template arguments for function templates</td>
207 <td><a href="https://wg21.link/cwg226">DR226</a></td>
208 <td class="full" align="center">Clang 2.9</td>
209 </tr>
210 <tr>
211 <td>Solving the SFINAE problem for expressions</td>
212 <td><a href="https://wg21.link/n2634">DR339</a></td>
213 <td class="full" align="center">Clang 2.9</td>
214 </tr>
215 <tr>
216 <td>Alias templates</td>
217 <td><a href="https://wg21.link/n2258">N2258</a></td>
218 <td class="full" align="center">Clang 3.0</td>
219 </tr>
220 <tr>
221 <td>Extern templates</td>
222 <td><a href="https://wg21.link/n1987">N1987</a></td>
223 <td class="full" align="center">Clang 2.9</td>
224 </tr>
225 <tr>
226 <td>Null pointer constant</td>
227 <td><a href="https://wg21.link/n2431">N2431</a></td>
228 <td class="full" align="center">Clang 3.0</td>
229 </tr>
230 <tr>
231 <td>Strongly-typed enums</td>
232 <td><a href="https://wg21.link/n2347">N2347</a></td>
233 <td class="full" align="center">Clang 2.9</td>
234 </tr>
235 <tr>
236 <td>Forward declarations for enums</td>
237 <td><a href="https://wg21.link/n2764">N2764</a>
238 <br><a href="https://wg21.link/cwg1206">DR1206</a></td>
239 <td class="full" align="center">Clang 3.1</td>
240 </tr>
241 <tr>
242 <td>Standardized attribute syntax</td>
243 <td><a href="https://wg21.link/n2761">N2761</a></td>
244 <td class="full" align="center">Clang 3.3 <a href="#n2761">(1)</a></td>
245 </tr>
246 <tr>
247 <td rowspan="2">Generalized constant expressions</td>
248 <td><a href="https://wg21.link/n2235">N2235</a></td>
249 <td class="full" align="center">Clang 3.1</td>
250 </tr>
251 <tr>
252 <!-- from Albuquerque 2017 -->
253 <td><a href="https://wg21.link/p0859r0">P0859R0</a> (<a href="#dr">DR</a>)</td>
254 <td class="full" align="center">Clang 8</td>
255 </tr>
256 <tr>
257 <td>Alignment support</td>
258 <td><a href="https://wg21.link/n2341">N2341</a></td>
259 <td class="full" align="center">Clang 3.3</td>
260 </tr>
261 <tr>
262 <td>Conditionally-support behavior</td>
263 <td><a href="https://wg21.link/n1627">N1627</a></td>
264 <td class="full" align="center">Clang 2.9</td>
265 </tr>
266 <tr>
267 <td>Changing undefined behavior into diagnosable errors</td>
268 <td><a href="https://wg21.link/n1727">N1727</a></td>
269 <td class="full" align="center">Clang 2.9</td>
270 </tr>
271 <tr>
272 <td>Delegating constructors</td>
273 <td><a href="https://wg21.link/n1986">N1986</a></td>
274 <td class="full" align="center">Clang 3.0</td>
275 </tr>
276 <tr>
277 <td rowspan="2">Inheriting constructors</td>
278 <td><a href="https://wg21.link/n2540">N2540</a></td>
279 <td class="full" align="center">Clang 3.3</td>
280 </tr>
281 <tr>
282 <!-- from Kona 2015 -->
283 <td><a href="https://wg21.link/p0136r1">P0136R1</a> (<a href="#dr">DR</a>)</td>
284 <td class="full" align="center">Clang 3.9</td>
285 </tr>
286 <tr>
287 <td>Explicit conversion operators</td>
288 <td><a href="https://wg21.link/n2437">N2437</a></td>
289 <td class="full" align="center">Clang 3.0</td>
290 </tr>
291 <tr>
292 <td>New character types</td>
293 <td><a href="https://wg21.link/n2249">N2249</a></td>
294 <td class="full" align="center">Clang 2.9</td>
295 </tr>
296 <tr>
297 <td>Unicode string literals</td>
298 <td><a href="https://wg21.link/n2442">N2442</a></td>
299 <td class="full" align="center">Clang 3.0</td>
300 </tr>
301 <tr>
302 <td>Raw string literals</td>
303 <td><a href="https://wg21.link/n2442">N2442</a></td>
304 <td class="full" align="center">Clang 3.0</td>
305 </tr>
306 <tr>
307 <td>Universal character names in literals</td>
308 <td><a href="https://wg21.link/n2170">N2170</a></td>
309 <td class="full" align="center">Clang 3.1</td>
310 </tr>
311 <tr>
312 <td>User-defined literals</td>
313 <td><a href="https://wg21.link/n2765">N2765</a></td>
314 <td class="full" align="center">Clang 3.1</td>
315 </tr>
316 <tr>
317 <td>Standard Layout Types</td>
318 <td><a href="https://wg21.link/n2342">N2342</a></td>
319 <td class="full" align="center">Clang 3.0</td>
320 </tr>
321 <tr>
322 <td rowspan="2">Defaulted functions</td>
323 <td><a href="https://wg21.link/n2346">N2346</a></td>
324 <td class="full" align="center">Clang 3.0</td>
325 </tr>
326 <tr> <!-- from Kona 2019-->
327 <td><a href="https://wg21.link/p1286r2">P1286R2</a> (<a href="#dr">DR</a>)</td>
328 <td class="full" align="center">Clang 9</td>
329 </tr>
330 <tr>
331 <td>Deleted functions</td>
332 <td><a href="https://wg21.link/n2346">N2346</a></td>
333 <td class="full" align="center">Clang 2.9</td>
334 </tr>
335 <tr>
336 <td>Extended friend declarations</td>
337 <td><a href="https://wg21.link/n1791">N1791</a></td>
338 <td class="full" align="center">Clang 2.9</td>
339 </tr>
340 <tr>
341 <td>Extending <code>sizeof</code></td>
342 <td><a href="https://wg21.link/n2253">N2253</a>
343 <br><a href="https://wg21.link/cwg850">DR850</a></td>
344 <td class="full" align="center">Clang 3.1</td>
345 </tr>
346 <tr>
347 <td>Inline namespaces</td>
348 <td><a href="https://wg21.link/n2535">N2535</a></td>
349 <td class="full" align="center">Clang 2.9</td>
350 </tr>
351 <tr>
352 <td>Unrestricted unions</td>
353 <td><a href="https://wg21.link/n2544">N2544</a></td>
354 <td class="full" align="center">Clang 3.1</td>
355 </tr>
356 <tr>
357 <td>Local and unnamed types as template arguments</td>
358 <td><a href="https://wg21.link/n2657">N2657</a></td>
359 <td class="full" align="center">Clang 2.9</td>
360 </tr>
361 <tr>
362 <td rowspan="2">Range-based for</td>
363 <td><a href="https://wg21.link/n2930">N2930</a></td>
364 <td class="full" align="center">Clang 3.0</td>
365 </tr>
366 <tr>
367 <!-- from Jacksonville 2018 -->
368 <td><a href="https://wg21.link/p0962r1">P0962R1</a> (<a href="#dr">DR</a>)</td>
369 <td class="full" align="center">Clang 8</td>
370 </tr>
371 <tr>
372 <td>Explicit virtual overrides</td>
373 <td><a href="https://wg21.link/n2928">N2928</a>
374 <br><a href="https://wg21.link/n3206">N3206</a>
375 <br><a href="https://wg21.link/n3272">N3272</a></td>
376 <td class="full" align="center">Clang 3.0</td>
377 </tr>
378 <tr>
379 <td>Minimal support for garbage collection and reachability-based leak detection</td>
380 <td><a href="https://wg21.link/n2670">N2670</a></td>
381 <td class="na" align="center">N/A <a href="#n2670">(2)</a></td>
382 </tr>
383 <tr>
384 <td>Allowing move constructors to throw [noexcept]</td>
385 <td><a href="https://wg21.link/n3050">N3050</a></td>
386 <td class="full" align="center">Clang 3.0</td>
387 </tr>
388 <tr>
389 <td>Defining move special member functions</td>
390 <td><a href="https://wg21.link/n3053">N3053</a></td>
391 <td class="full" align="center">Clang 3.0</td>
392 </tr>
394 <tr class="separator">
395 <th align="center" colspan="3">Concurrency</th>
396 </tr>
397 <tr>
398 <td>Sequence points</td>
399 <td><a href="https://wg21.link/n2239">N2239</a></td>
400 <td class="full" align="center">Clang 3.3</td>
401 </tr>
402 <tr>
403 <td>Atomic operations</td>
404 <td><a href="https://wg21.link/n2427">N2427</a></td>
405 <td class="full" align="center">Clang 3.1</td>
406 </tr>
407 <tr>
408 <td>Strong Compare and Exchange</td>
409 <td><a href="https://wg21.link/n2748">N2748</a></td>
410 <td class="full" align="center">Clang 3.1 <a href="#n2748">(3)</a></td>
411 </tr>
412 <tr>
413 <td>Bidirectional Fences</td>
414 <td><a href="https://wg21.link/n2752">N2752</a></td>
415 <td class="full" align="center">Clang 3.1</td>
416 </tr>
418 <tr>
419 <td>Memory model</td>
420 <td><a href="https://wg21.link/n2429">N2429</a></td>
421 <td class="full" align="center">Clang 3.2</td>
422 </tr>
423 <tr>
424 <td>Data-dependency ordering: atomics and memory model</td>
425 <td><a href="https://wg21.link/n2664">N2664</a></td>
426 <td class="full" align="center">Clang 3.2 <a href="#n2664">(4)</a></td>
427 </tr>
428 <tr>
429 <td>Propagating exceptions</td>
430 <td><a href="https://wg21.link/n2179">N2179</a></td>
431 <td class="full" align="center">Clang 2.9</td>
432 </tr>
433 <tr>
434 <td>Allow atomics use in signal handlers</td>
435 <td><a href="https://wg21.link/n2547">N2547</a></td>
436 <td class="full" align="center">Clang 3.1</td>
437 </tr>
438 <tr>
439 <td>Thread-local storage</td>
440 <td><a href="https://wg21.link/n2659">N2659</a></td>
441 <td class="full" align="center">Clang 3.3 <a href="#n2659">(5)</a></td>
442 </tr>
443 <tr>
444 <td>Dynamic initialization and destruction with concurrency</td>
445 <td><a href="https://wg21.link/n2660">N2660</a></td>
446 <td class="full" align="center">Clang 2.9</td>
447 </tr>
449 <tr class="separator">
450 <th align="center" colspan="3">C99 Features in C++11</th>
451 </tr>
452 <tr>
453 <td><code>__func__</code> predefined identifier</td>
454 <td><a href="https://wg21.link/n2340">N2340</a></td>
455 <td class="full" align="center">Clang 2.9</td>
456 </tr>
457 <tr>
458 <td>C99 preprocessor</td>
459 <td><a href="https://wg21.link/n1653">N1653</a></td>
460 <td class="full" align="center">Clang 2.9</td>
461 </tr>
462 <tr>
463 <td><code>long long</code></td>
464 <td><a href="https://wg21.link/n1811">N1811</a></td>
465 <td class="full" align="center">Clang 2.9</td>
466 </tr>
467 <tr>
468 <td>Extended integral types</td>
469 <td><a href="https://wg21.link/n1988">N1988</a></td>
470 <td class="na" align="center">N/A <a href="#n1988">(6)</a></td>
471 </tr>
472 </table>
475 <span id="n2761">(1): The <code>[[carries_dependency]]</code> attribute
476 has no effect.</span><br>
477 <span id="n2670">(2): No compiler changes are required for an implementation
478 such as Clang that does not provide garbage collection.</span><br>
479 <span id="n2748">(3): All compare-exchange operations are emitted as
480 strong compare-exchanges.</span><br>
481 <span id="n2664">(4): <code>memory_order_consume</code> is lowered to
482 <code>memory_order_acquire</code>.</span><br>
483 <span id="n2659">(5): <code>thread_local</code> support
484 requires a C++ runtime library providing <code>__cxa_thread_atexit</code>, such
485 as <a href="https://libcxxabi.llvm.org">libc++abi</a> 3.6 or later,
486 or libsupc++ 4.8 or later.</span><br>
487 <span id="n1988">(6): No compiler changes are required for an implementation
488 such as Clang that does not provide any extended integer types.
489 <code>__int128</code> is not treated as an extended integer type,
490 because changing <code>intmax_t</code> would be an ABI-incompatible
491 change.</span>
492 </p>
493 </details>
495 <h2 id="cxx14">C++14 implementation status</h2>
497 <p>Clang 3.4 and later implement all of the <a
498 href="https://www.iso.org/standard/64029.html">ISO
499 C++ 2014 standard</a>.</p>
501 <p>By default, Clang builds C++ code according to the C++14 standard.
502 You can use Clang in C++14 mode with the <code>-std=c++14</code> option
503 (use <code>-std=c++1y</code> in Clang 3.4 and earlier).</p>
505 <details>
506 <summary>List of features and minimum Clang version with support</summary>
508 <table width="689" border="1" cellspacing="0">
509 <tr>
510 <th>Language Feature</th>
511 <th>C++14 Proposal</th>
512 <th>Available in Clang?</th>
513 </tr>
514 <tr>
515 <td>Tweak to certain C++ contextual conversions</td>
516 <td><a href="https://wg21.link/n3323">N3323</a></td>
517 <td class="full" align="center">Clang 3.4</td>
518 </tr>
519 <tr>
520 <td>Binary literals</td>
521 <td><a href="https://wg21.link/n3472">N3472</a></td>
522 <td class="full" align="center">Clang 2.9</td>
523 </tr>
524 <tr>
525 <td>decltype(auto)</td>
526 <td rowspan=2 style="vertical-align:middle"><a href="https://wg21.link/n3638">N3638</a></td>
527 <td class="full" align="center">Clang 3.3</td>
528 </tr>
529 <tr>
530 <td>Return type deduction for normal functions</td>
531 <td class="full" align="center">Clang 3.4</td>
532 </tr>
533 <tr>
534 <td>Initialized lambda captures</td>
535 <td><a href="https://wg21.link/n3648">N3648</a></td>
536 <td class="full" align="center">Clang 3.4</td>
537 </tr>
538 <tr>
539 <td>Generic lambdas</td>
540 <td><a href="https://wg21.link/n3649">N3649</a></td>
541 <td class="full" align="center">Clang 3.4</td>
542 </tr>
543 <tr>
544 <td>Variable templates</td>
545 <td><a href="https://wg21.link/n3651">N3651</a></td>
546 <td class="full" align="center">Clang 3.4</td>
547 </tr>
548 <tr>
549 <td>Relaxing requirements on constexpr functions</td>
550 <td><a href="https://wg21.link/n3652">N3652</a></td>
551 <td class="full" align="center">Clang 3.4</td>
552 </tr>
553 <tr>
554 <td>Member initializers and aggregates</td>
555 <td><a href="https://wg21.link/n3653">N3653</a></td>
556 <td class="full" align="center">Clang 3.3</td>
557 </tr>
558 <tr>
559 <td>Clarifying memory allocation</td>
560 <td><a href="https://wg21.link/n3664">N3664</a></td>
561 <td class="full" align="center">Clang 3.4</td>
562 </tr>
563 <tr>
564 <td><tt>[[deprecated]]</tt> attribute</td>
565 <td><a href="https://wg21.link/n3760">N3760</a></td>
566 <td class="full" align="center">Clang 3.4</td>
567 </tr>
568 <tr>
569 <td>Single quotation mark as digit separator</td>
570 <td><a href="https://wg21.link/n3781">N3781</a></td>
571 <td class="full" align="center">Clang 3.4</td>
572 </tr>
573 <tr>
574 <td>C++ Sized Deallocation</td>
575 <td><a href="https://wg21.link/n3778">N3778</a></td>
576 <td class="full" align="center">Clang 3.4 <a href="#n3778">(7)</a></td>
577 </tr>
578 </table>
581 <span id="n3778">(7): In Clang 3.7 and later, sized deallocation is only enabled
582 if the user passes the <code>-fsized-deallocation</code> flag. The user must
583 supply definitions of the sized deallocation functions, either by providing them
584 explicitly or by using a C++ standard library that does. <code>libstdc++</code>
585 added these functions in version 5.0, and <code>libc++</code> added them in
586 version 3.7.
587 </span>
588 </p>
589 </details>
591 <h2 id="cxx17">C++17 implementation status</h2>
593 <p>Clang 5 and later implement all the features of the
594 <a href="https://www.iso.org/standard/68564.html">ISO C++ 2017 standard</a>.</p>
596 <p>You can use Clang in C++17 mode with the <code>-std=c++17</code> option
597 (use <code>-std=c++1z</code> in Clang 4 and earlier).</p>
599 <details open>
600 <summary>List of features and minimum Clang version with support</summary>
602 <table width="689" border="1" cellspacing="0">
603 <tr>
604 <th>Language Feature</th>
605 <th>C++17 Proposal</th>
606 <th>Available in Clang?</th>
607 </tr>
608 <!-- Issaquah 2014 papers -->
609 <tr>
610 <td><tt>static_assert</tt> with no message</td>
611 <td><a href="https://wg21.link/n3928">N3928</a></td>
612 <td class="full" align="center">Clang 3.5</td>
613 </tr>
614 <!-- Rapperswil papers -->
615 <tr>
616 <td>Disabling trigraph expansion by default</td>
617 <td><a href="https://wg21.link/n4086">N4086</a></td>
618 <td class="full" align="center">Clang 3.5</td>
619 </tr>
620 <tr>
621 <td><tt>typename</tt> in a template template parameter</td>
622 <td><a href="https://wg21.link/n4051">N4051</a></td>
623 <td class="full" align="center">Clang 3.5</td>
624 </tr>
625 <tr>
626 <td>New <tt>auto</tt> rules for direct-list-initialization
627 <td><a href="https://wg21.link/n3922">N3922</a></td>
628 <td class="full" align="center">Clang 3.8 <a href="#n3922">(8)</a></td>
629 </tr>
630 <!-- Urbana papers -->
631 <tr>
632 <td rowspan="2">Fold expressions</td>
633 <td><a href="https://wg21.link/n4295">N4295</a></td>
634 <td class="full" align="center">Clang 3.6</td>
635 </tr>
636 <tr> <!-- from Jacksonville -->
637 <td><a href="https://wg21.link/p0036r0">P0036R0</a></td>
638 <td class="full" align="center">Clang 3.9</td>
639 </tr>
640 <tr>
641 <td><tt>u8</tt> character literals</td>
642 <td><a href="https://wg21.link/n4267">N4267</a></td>
643 <td class="full" align="center">Clang 3.6</td>
644 </tr>
645 <tr>
646 <td>Nested namespace definition</td>
647 <td><a href="https://wg21.link/n4230">N4230</a></td>
648 <td class="full" align="center">Clang 3.6</td>
649 </tr>
650 <tr>
651 <td>Attributes for namespaces and enumerators</td>
652 <td><a href="https://wg21.link/n4266">N4266</a></td>
653 <td class="full" align="center">Clang 3.6</td>
654 </tr>
655 <tr>
656 <td>Allow constant evaluation for all non-type template arguments</td>
657 <td><a href="https://wg21.link/n4268">N4268</a></td>
658 <td class="full" align="center">Clang 3.6</td>
659 </tr>
660 <!-- Kona papers -->
661 <tr>
662 <td>Remove deprecated <tt>register</tt> storage class</td>
663 <td><a href="https://wg21.link/p0001r1">P0001R1</a></td>
664 <td class="full" align="center">Clang 3.8</td>
665 </tr>
666 <tr>
667 <td>Remove deprecated <tt>bool</tt> increment</td>
668 <td><a href="https://wg21.link/p0002r1">P0002R1</a></td>
669 <td class="full" align="center">Clang 3.8</td>
670 </tr>
671 <tr>
672 <td>Make exception specifications part of the type system</td>
673 <td><a href="https://wg21.link/p0012r1">P0012R1</a></td>
674 <td class="full" align="center">Clang 4</td>
675 </tr>
676 <tr>
677 <td><tt>__has_include</tt> in preprocessor conditionals</td>
678 <td><a href="https://wg21.link/p0061r1">P0061R1</a></td>
679 <td class="full" align="center">Yes</td>
680 </tr>
681 <!-- Jacksonville papers -->
682 <tr>
683 <td><tt>[[fallthrough]]</tt> attribute</td>
684 <td><a href="https://wg21.link/p0188r1">P0188R1</a></td>
685 <td class="full" align="center">Clang 3.9</td>
686 </tr>
687 <tr>
688 <td rowspan="2"><tt>[[nodiscard]]</tt> attribute</td>
689 <td><a href="https://wg21.link/p0189r1">P0189R1</a></td>
690 <td class="full" align="center">Clang 3.9</td>
691 </tr>
692 <tr> <!-- from Cologne 2019 -->
693 <td><a href="https://wg21.link/p1771r1">P1771R1</a> (<a href="#dr">DR</a>)</td>
694 <td class="full" align="center">Clang 9</td>
695 </tr>
696 <tr>
697 <td><tt>[[maybe_unused]]</tt> attribute</td>
698 <td><a href="https://wg21.link/p0212r1">P0212R1</a></td>
699 <td class="full" align="center">Clang 3.9</td>
700 </tr>
701 <tr>
702 <td>Aggregate initialization of classes with base classes</td>
703 <td><a href="https://wg21.link/p0017r1">P0017R1</a></td>
704 <td class="full" align="center">Clang 3.9</td>
705 </tr>
706 <tr>
707 <td><tt>constexpr</tt> lambda expressions</td>
708 <td><a href="https://wg21.link/p0170r1">P0170R1</a></td>
709 <td class="full" align="center">Clang 5</td>
710 </tr>
711 <tr>
712 <td>Differing <tt>begin</tt> and <tt>end</tt> types in range-based <tt>for</tt></td>
713 <td><a href="https://wg21.link/p0184r0">P0184R0</a></td>
714 <td class="full" align="center">Clang 3.9</td>
715 </tr>
716 <tr>
717 <td>Lambda capture of <tt>*this</tt></td>
718 <td><a href="https://wg21.link/p0018r3">P0018R3</a></td>
719 <td class="full" align="center">Clang 3.9</td>
720 </tr>
721 <tr>
722 <td>Direct-list-initialization of <tt>enum</tt>s</td>
723 <td><a href="https://wg21.link/p0138r2">P0138R2</a></td>
724 <td class="full" align="center">Clang 3.9</td>
725 </tr>
726 <tr>
727 <td>Hexadecimal floating-point literals</td>
728 <td><a href="https://wg21.link/p0245r1">P0245R1</a></td>
729 <td class="full" align="center">Yes</td>
730 </tr>
731 <!-- Oulu papers -->
732 <tr>
733 <td>Using attribute namespaces without repetition</td>
734 <td><a href="https://wg21.link/p0028r4">P0028R4</a></td>
735 <td class="full" align="center">Clang 3.9</td>
736 </tr>
737 <tr>
738 <td>Dynamic memory allocation for over-aligned data</td>
739 <td><a href="https://wg21.link/p0035r4">P0035R4</a></td>
740 <td class="full" align="center">Clang 4</td>
741 </tr>
742 <tr>
743 <td rowspan="4">Template argument deduction for class templates</td>
744 <td><a href="https://wg21.link/p0091r3">P0091R3</a></td>
745 <td rowspan="2" class="full" align="center">Clang 5</td>
746 </tr>
747 <tr> <!-- from Issaquah -->
748 <td><a href="https://wg21.link/p0512r0">P0512R0</a></td>
749 </tr>
750 <tr>
751 <!-- from Kona 2017 -->
752 <td><a href="https://wg21.link/p0620r1">P0620R0</a> (<a href="#dr">DR</a>)</td>
753 <td class="full" align="center">Clang 7</td>
754 </tr>
755 <tr>
756 <!-- from Toronto 2017 -->
757 <td><a href="https://wg21.link/p0702r1">P0702R1</a> (<a href="#dr">DR</a>)</td>
758 <td class="full" align="center">Clang 6</td>
759 </tr>
760 <tr>
761 <td>Non-type template parameters with <tt>auto</tt> type</td>
762 <td><a href="https://wg21.link/p0127r2">P0127R2</a></td>
763 <td class="full" align="center">Clang 4</td>
764 </tr>
765 <tr>
766 <td>Guaranteed copy elision</td>
767 <td><a href="https://wg21.link/p0135r1">P0135R1</a></td>
768 <td class="full" align="center">Clang 4</td>
769 </tr>
770 <tr>
771 <td rowspan=2>Stricter expression evaluation order</td>
772 <td><a href="https://wg21.link/p0145r3">P0145R3</a></td>
773 <td class="full" align="center" rowspan=2>Clang 4 <a href="#p0145">(9)</a></td>
774 </tr>
775 <tr>
776 <td><a href="https://wg21.link/p0400r0">P0400R0</a></td>
777 </tr>
778 <tr>
779 <td>Requirement to ignore unknown attributes</td>
780 <td><a href="https://wg21.link/p0283r2">P0283R2</a></td>
781 <td class="full" align="center">Yes</td>
782 </tr>
783 <tr>
784 <td><tt>constexpr</tt> <em>if-statement</em>s</td>
785 <td><a href="https://wg21.link/p0292r2">P0292R2</a></td>
786 <td class="full" align="center">Clang 3.9</td>
787 </tr>
788 <tr>
789 <td>Inline variables</td>
790 <td><a href="https://wg21.link/p0386r2">P0386R2</a></td>
791 <td class="full" align="center">Clang 3.9</td>
792 </tr>
793 <tr>
794 <td rowspan="3">Structured bindings</td>
795 <td><a href="https://wg21.link/p0217r3">P0217R3</a></td>
796 <td class="full" align="center">Clang 4</td>
797 </tr>
798 <tr>
799 <!-- from Jacksonville 2018 -->
800 <td><a href="https://wg21.link/p0961r1">P0961R1</a> (<a href="#dr">DR</a>)</td>
801 <td class="full" align="center">Clang 8</td>
802 </tr>
803 <tr>
804 <!-- from Jacksonville 2018 -->
805 <td><a href="https://wg21.link/p0969r0">P0969R0</a> (<a href="#dr">DR</a>)</td>
806 <td class="full" align="center">Clang 8</td>
807 </tr>
808 <tr>
809 <td>Separate variable and condition for <tt>if</tt> and <tt>switch</tt></td>
810 <td><a href="https://wg21.link/p0305r1">P0305R1</a></td>
811 <td class="full" align="center">Clang 3.9</td>
812 </tr>
813 <!-- Issaquah 2016 papers -->
814 <tr>
815 <td>Matching template template parameters to compatible arguments</td>
816 <td><a href="https://wg21.link/p0522r0">P0522R0</a></td>
817 <td class="partial" align="center">Partial <a href="#p0522">(10)</a></td>
818 </tr>
819 <tr>
820 <td>Removing deprecated dynamic exception specifications</td>
821 <td><a href="https://wg21.link/p0003r5">P0003R5</a></td>
822 <td class="full" align="center">Clang 4</td>
823 </tr>
824 <tr>
825 <td>Pack expansions in <em>using-declarations</em></td>
826 <td><a href="https://wg21.link/p0195r2">P0195R2</a></td>
827 <td class="full" align="center">Clang 4</td>
828 </tr>
829 </table>
832 <span id="n3922">(8): This is a backwards-incompatible change that is applied to
833 all language versions that allow type deduction from <tt>auto</tt>
834 (per the request of the C++ committee).
835 In Clang 3.7, a warning is emitted for all cases that would change meaning.
836 </span><br>
837 <span id="p0145">(9): Under the MS ABI, function parameters are destroyed from
838 left to right in the callee. As a result, function parameters in calls to
839 <tt>operator&lt;&lt;</tt>, <tt>operator&gt;&gt;</tt>, <tt>operator-&gt;*</tt>,
840 <tt>operator&amp;&amp;</tt>, <tt>operator||</tt>, and <tt>operator,</tt>
841 functions using expression syntax are no longer guaranteed to be destroyed in
842 reverse construction order in that ABI.
843 This is not fully supported during constant expression evaluation until Clang 12.
844 </span><br>
845 <span id="p0522">(10): Despite being the resolution to a Defect Report, this
846 feature is disabled by default in all language versions, and can be enabled
847 explicitly with the flag <tt>-frelaxed-template-template-args</tt> in Clang 4
848 onwards.
849 The change to the standard lacks a corresponding change for template partial
850 ordering, resulting in ambiguity errors for reasonable and previously-valid
851 code. This issue is expected to be rectified soon.
852 </span>
853 </p>
854 </details>
856 <h2 id="cxx20">C++20 implementation status</h2>
858 <p>Clang has support for some of the features of the
859 <a href="https://www.iso.org/standard/79358.html">ISO C++ 2020 standard</a>.</p>
861 <p>You can use Clang in C++20 mode with the <code>-std=c++20</code> option
862 (use <code>-std=c++2a</code> in Clang 9 and earlier).</p>
864 <details open>
865 <summary>List of features and minimum Clang version with support</summary>
867 <table width="689" border="1" cellspacing="0">
868 <tr>
869 <th>Language Feature</th>
870 <th>C++20 Proposal</th>
871 <th>Available in Clang?</th>
872 </tr>
873 <!-- Toronto 2017 papers -->
874 <tr>
875 <td>Default member initializers for bit-fields</td>
876 <td><a href="https://wg21.link/p0683r1">P0683R1</a></td>
877 <td class="full" align="center">Clang 6</td>
878 </tr>
879 <tr>
880 <td><tt>const&amp;</tt>-qualified pointers to members</td>
881 <td><a href="https://wg21.link/p0704r1">P0704R1</a></td>
882 <td class="full" align="center">Clang 6</td>
883 </tr>
884 <tr>
885 <td>Allow <i>lambda-capture</i> <tt>[=, this]</tt></td>
886 <td><a href="https://wg21.link/p0409r2">P0409R2</a></td>
887 <td class="full" align="center">Clang 6</td>
888 </tr>
889 <tr>
890 <td rowspan="2"><tt>__VA_OPT__</tt> for preprocessor comma elision</td>
891 <td><a href="https://wg21.link/p0306r4">P0306R4</a></td>
892 <td class="full" align="center">Clang 6</td>
893 </tr>
894 <tr> <!-- from Rapperswil -->
895 <td><a href="https://wg21.link/p1042r1">P1042R1</a></td>
896 <td class="full" align="center">Clang 9</td>
897 </tr>
898 <tr>
899 <td>Designated initializers</td>
900 <td><a href="https://wg21.link/p0329r4">P0329R4</a></td>
901 <td class="full" align="center">Clang 10</td>
902 </tr>
903 <tr>
904 <td><i>template-parameter-list</i> for generic lambdas</td>
905 <td><a href="https://wg21.link/p0428r2">P0428R2</a></td>
906 <td class="full" align="center">Clang 9</td>
907 </tr>
908 <tr id="p0734">
909 <td rowspan="13">Concepts</td>
910 <td><a href="https://wg21.link/p0734r0">P0734R0</a></td>
911 <td class="full" align="center">Clang 10</td>
912 </tr>
913 <tr> <!-- from Albuquerque -->
914 <td><a href="https://wg21.link/p0857r0">P0857R0</a></td>
915 <td class="partial" align="center">
916 <details><summary>Partial</summary>
917 Constraining template template parameters is not yet supported.
918 </details>
919 </td>
920 </tr>
921 <tr> <!-- from San Diego -->
922 <td><a href="https://wg21.link/p1084r2">P1084R2</a></td>
923 <td rowspan="2" class="full" align="center">Clang 10</td>
924 </tr>
925 <tr>
926 <td><a href="https://wg21.link/p1141r2">P1141R2</a></td>
927 </tr>
928 <tr> <!-- from Cologne -->
929 <td><a href="https://wg21.link/p0848r3">P0848R3</a></td>
930 <td rowspan="1" class="unreleased" align="center">
931 <details>
932 <summary>Clang 16 (Partial)</summary>
933 Because of other concepts implementation deficits, the __cpp_concepts macro is not yet set to 202002L.
934 Also, the related defect reports <a href="https://wg21.link/cwg1496">DR1496</a> and
935 <a href="https://wg21.link/cwg1734">DR1734</a> are not yet implemented. Accordingly, deleted
936 special member functions are treated as eligible even though they shouldn't be.
937 </details>
938 </td>
939 </tr>
940 <tr>
941 <td><a href="https://wg21.link/p1616r1">P1616R1</a></td>
942 <td rowspan="2" class="full" align="center">Clang 10</td>
943 </tr>
944 <tr>
945 <td><a href="https://wg21.link/p1452r2">P1452R2</a></td>
946 </tr>
947 <tr> <!-- from Belfast -->
948 <td><a href="https://wg21.link/p1972r0">P1972R0</a></td>
949 <td rowspan="4" class="full" align="center">Clang 10</td>
950 </tr>
951 <tr>
952 <td><a href="https://wg21.link/p1980r0">P1980R0</a></td>
953 </tr>
954 <tr> <!-- from Prague -->
955 <td><a href="https://wg21.link/p2103r0">P2103R0</a></td>
956 </tr>
957 <tr> <!-- from February 2022 -->
958 <td><a href="https://wg21.link/p2493r0">P2493R0</a></td>
959 </tr>
960 <tr>
961 <td><a href="https://wg21.link/p2092r0">P2092R0</a></td>
962 <td rowspan="1" class="partial" align="center">
963 <details><summary>Partial</summary>
964 <tt>typename</tt> not yet optional (depends on P0634R3).
965 </details>
966 </td>
967 </tr>
968 <tr>
969 <td><a href="https://wg21.link/p2113r0">P2113R0</a></td>
970 <td rowspan="1" class="none" align="center">No</td>
971 </tr>
972 <!-- Albuquerque papers -->
973 <tr>
974 <td>Range-based for statements with initializer</td>
975 <td><a href="https://wg21.link/p0614r1">P0614R1</a></td>
976 <td class="full" align="center">Clang 8</td>
977 </tr>
978 <tr>
979 <td>ADL and function templates that are not visible</td>
980 <td><a href="https://wg21.link/p0846r0">P0846R0</a></td>
981 <td class="full" align="center">Clang 9</td>
982 </tr>
983 <tr>
984 <td><tt>const</tt> mismatch with defaulted copy constructor</td>
985 <td><a href="https://wg21.link/p0641r2">P0641R2</a></td>
986 <td class="full" align="center">Clang 8</td>
987 </tr>
988 <tr>
989 <td rowspan="10">Consistent comparison (<tt>operator&lt;=&gt;</tt>)</td>
990 <td><a href="https://wg21.link/p0515r3">P0515R3</a></td>
991 <td rowspan="8" class="full" align="center">Clang 10</td>
992 </tr>
993 <tr> <!-- from Jacksonville -->
994 <td><a href="https://wg21.link/p0905r1">P0905R1</a></td>
995 </tr>
996 <tr> <!-- from Rapperswil -->
997 <td><a href="https://wg21.link/p1120r0">P1120R0</a></td>
998 </tr>
999 <tr> <!-- from Kona 2019 -->
1000 <td><a href="https://wg21.link/p1185r2">P1185R2</a></td>
1001 </tr>
1002 <tr> <!-- from Cologne -->
1003 <td><a href="https://wg21.link/p1186r3">P1186R3</a></td>
1004 </tr>
1005 <tr>
1006 <td><a href="https://wg21.link/p1630r1">P1630R1</a></td>
1007 </tr>
1008 <tr> <!-- from Belfast -->
1009 <td><a href="https://wg21.link/p1946r0">P1946R0</a></td>
1010 </tr>
1011 <tr>
1012 <td><a href="https://wg21.link/p1959r0">P1959R0</a></td>
1013 </tr>
1014 <tr> <!-- from Prague -->
1015 <td><a href="https://wg21.link/p2002r1">P2002R1</a></td>
1016 <td class="partial" align="center">Partial</td>
1017 </tr>
1018 <tr>
1019 <td><a href="https://wg21.link/p2085r0">P2085R0</a></td>
1020 <td class="full" align="center">Clang 14</td>
1021 </tr>
1022 <tr>
1023 <td>Access checking on specializations</td>
1024 <td><a href="https://wg21.link/p0692r1">P0692R1</a></td>
1025 <td class="full" align="center">Clang 14</td>
1026 </tr>
1027 <tr>
1028 <td>Default constructible and assignable stateless lambdas</td>
1029 <td><a href="https://wg21.link/p0624r2">P0624R2</a></td>
1030 <td class="full" align="center">Clang 8</td>
1031 </tr>
1032 <tr>
1033 <td>Lambdas in unevaluated contexts</td>
1034 <td><a href="https://wg21.link/p0315r4">P0315R4</a></td>
1035 <td class="partial" align="center">
1036 <details><summary>Partial</summary>
1037 temp.deduct/9 is not implemented yet.
1038 </details>
1039 </td>
1040 </tr>
1041 <!-- Jacksonville papers -->
1042 <tr>
1043 <td><tt>[[no_unique_address]]</tt> attribute</td>
1044 <td><a href="https://wg21.link/p0840r2">P0840R2</a></td>
1045 <td class="full" align="center">Clang 9</td>
1046 </tr>
1047 <tr>
1048 <td><tt>[[likely]]</tt> and <tt>[[unlikely]]</tt> attributes</td>
1049 <td><a href="https://wg21.link/p0479r5">P0479R5</a></td>
1050 <td class="full" align="center">Clang 12</td>
1051 </tr>
1052 <tr>
1053 <td><tt>typename</tt> optional in more contexts</td>
1054 <td><a href="https://wg21.link/p0634r3">P0634R3</a></td>
1055 <td class="none" align="center">No</td>
1056 </tr>
1057 <tr>
1058 <td>Pack expansion in lambda <i>init-capture</i></td>
1059 <td><a href="https://wg21.link/p0780r2">P0780R2</a></td>
1060 <td class="full" align="center">Clang 9</td>
1061 </tr>
1062 <!-- Rapperswil papers -->
1063 <tr>
1064 <td rowspan="2">Class types as non-type template parameters</td>
1065 <td><a href="https://wg21.link/p0732r2">P0732R2</a></td>
1066 <td rowspan="2" class="partial" align="center">Partial</td>
1067 </tr>
1068 <tr> <!-- from Belfast -->
1069 <td><a href="https://wg21.link/p1907r1">P1907R1</a></td>
1070 </tr>
1071 <tr>
1072 <td>Destroying operator delete</td>
1073 <td><a href="https://wg21.link/p0722r3">P0722R3</a></td>
1074 <td class="full" align="center">Clang 6</td>
1075 </tr>
1076 <tr>
1077 <td rowspan="7">Relaxations of <tt>constexpr</tt> restrictions</td>
1078 <td><a href="https://wg21.link/p1064r0">P1064R0</a></td>
1079 <td class="full" align="center">Clang 9</td>
1080 </tr>
1081 <tr> <!-- from San Diego -->
1082 <td><a href="https://wg21.link/p1002r1">P1002R1</a></td>
1083 <td class="full" align="center">Clang 8</td>
1084 </tr>
1085 <tr>
1086 <td><a href="https://wg21.link/p1327r1">P1327R1</a></td>
1087 <td rowspan="2" class="full" align="center">Clang 9</td>
1088 </tr>
1089 <tr>
1090 <td><a href="https://wg21.link/p1330r0">P1330R0</a></td>
1091 </tr>
1092 <tr> <!-- from Cologne -->
1093 <td><a href="https://wg21.link/p1331r2">P1331R2</a></td>
1094 <td rowspan="3" class="full" align="center">Clang 10</td>
1095 </tr>
1096 <tr>
1097 <td><a href="https://wg21.link/p1668r1">P1668R1</a></td>
1098 </tr>
1099 <tr>
1100 <td><a href="https://wg21.link/p0784r7">P0784R7</a></td>
1101 </tr>
1102 <tr>
1103 <td>Prohibit aggregates with user-declared constructors</td>
1104 <td><a href="https://wg21.link/p1008r1">P1008R1</a></td>
1105 <td class="full" align="center">Clang 8</td>
1106 </tr>
1107 <tr>
1108 <td>Feature test macros</td>
1109 <td><a href="https://wg21.link/p0941r2">P0941R2</a></td>
1110 <td class="full" align="center"><a href="#sd6">(see below)</a></td>
1111 </tr>
1112 <tr>
1113 <td><tt>explicit(bool)</tt></td>
1114 <td><a href="https://wg21.link/p0892r2">P0892R2</a></td>
1115 <td class="full" align="center">Clang 9</td>
1116 </tr>
1117 <!-- San Diego papers -->
1118 <tr>
1119 <td>Signed integers are two's complement</td>
1120 <td><a href="https://wg21.link/p1236r1">P1236R1</a></td>
1121 <td class="full" align="center">Clang 9</td>
1122 </tr>
1123 <tr>
1124 <td><tt>char8_t</tt></td>
1125 <td><a href="https://wg21.link/p0482r6">P0482R6</a></td>
1126 <td class="full" align="center">Clang 7 <a href="#p0482">(11)</a></td>
1127 </tr>
1128 <tr>
1129 <td rowspan=2>Immediate functions (<tt>consteval</tt>)</td>
1130 <td><a href="https://wg21.link/p1073r3">P1073R3</a></td>
1131 <td class="full" align="center">Clang 15</td>
1132 </tr>
1133 <tr> <!-- from Prague -->
1134 <td><a href="https://wg21.link/p1937r2">P1937R2</a></td>
1135 <td class="full" align="center">Clang 14</td>
1136 </tr>
1137 <tr>
1138 <td><tt>std::is_constant_evaluated</tt></td>
1139 <td><a href="https://wg21.link/p0595r2">P0595R2</a></td>
1140 <td class="full" align="center">Clang 9</td>
1141 </tr>
1142 <tr>
1143 <td>Nested inline namespaces</td>
1144 <td><a href="https://wg21.link/p1094r2">P1094R2</a></td>
1145 <td class="full" align="center">Clang 8</td>
1146 </tr>
1147 <!-- Kona 2019 papers -->
1148 <tr>
1149 <td rowspan="2">Structured binding extensions</td>
1150 <td><a href="https://wg21.link/p1091r3">P1091R3</a></td>
1151 <td rowspan="2" class="unreleased" align="center">Clang 16</td>
1152 </tr>
1153 <tr>
1154 <td><a href="https://wg21.link/p1381r1">P1381R1</a></td>
1155 </tr>
1156 <tr>
1157 <td rowspan="2">Stronger Unicode requirements</td>
1158 <td><a href="https://wg21.link/p1041r4">P1041R4</a></td>
1159 <td rowspan="2" class="full" align="center">Yes</td>
1160 </tr>
1161 <tr>
1162 <td><a href="https://wg21.link/p1139r2">P1139R2</a></td>
1163 </tr>
1164 <tr>
1165 <td rowspan="2">Parenthesized initialization of aggregates</td>
1166 <td><a href="https://wg21.link/p0960r3">P0960R3</a></td>
1167 <td rowspan="2" class="none" align="center">No</td>
1168 </tr>
1169 <tr> <!-- from Belfast -->
1170 <td><a href="https://wg21.link/p1975r0">P1975R0</a></td>
1171 </tr>
1172 <tr>
1173 <td rowspan="10">Modules</td>
1174 <td><a href="https://wg21.link/p1103r3">P1103R3</a></td>
1175 <td class="full" align="center">Clang 15</td>
1176 </tr>
1177 <tr> <!-- from Cologne -->
1178 <td><a href="https://wg21.link/p1766r1">P1766R1</a> (<a href="#dr">DR</a>)</td>
1179 <td class="full" align="center">Clang 11</td>
1180 </tr>
1181 <tr>
1182 <td><a href="https://wg21.link/p1811r0">P1811R0</a></td>
1183 <td class="none" align="center">No</td>
1184 </tr>
1185 <tr>
1186 <td><a href="https://wg21.link/p1703r1">P1703R1</a></td>
1187 <td class="none" align="center">Subsumed by P1857</td>
1188 </tr>
1189 <tr> <!-- from Belfast -->
1190 <td><a href="https://wg21.link/p1874r1">P1874R1</a></td>
1191 <td class="full" align="center">Clang 15</td>
1192 </tr>
1193 <tr> <!-- from Belfast -->
1194 <td><a href="https://wg21.link/p1979r0">P1979R0</a></td>
1195 <td class="none" align="center">No</td>
1196 </tr>
1197 <tr> <!-- from Prague -->
1198 <td><a href="https://wg21.link/p1779r3">P1779R3</a></td>
1199 <td class="full" align="center">Clang 15</td>
1200 </tr>
1201 <tr>
1202 <td><a href="https://wg21.link/p1857r3">P1857R3</a></td>
1203 <td class="none" align="center">No</td>
1204 </tr>
1205 <tr>
1206 <td><a href="https://wg21.link/p2115r0">P2115R0</a></td>
1207 <td class="partial" align="center">Partial</td>
1208 </tr>
1209 <tr>
1210 <td><a href="https://wg21.link/p1815r2">P1815R2</a></td>
1211 <td class="partial" align="center">Partial</td>
1212 </tr>
1213 <tr>
1214 <td>Coroutines</td>
1215 <td><a href="https://wg21.link/p0912r5">P0912R5</a></td>
1216 <td class="partial" align="center">
1217 <details><summary>Partial</summary>
1218 The optimizer does not yet handle TLS with
1219 <tt>__attribute__((const))</tt> attribute correctly. There can be issues where the
1220 coroutine may resume on a different thread. <br \>This feature requires further
1221 analysis of the C++ Standard to determine what work is necessary for conformance.
1222 </details></td>
1223 </tr>
1224 <!-- Cologne 2019 papers -->
1225 <tr>
1226 <td>Deprecate <tt>a[b,c]</tt></td>
1227 <td><a href="https://wg21.link/p1161r3">P1161R3</a></td>
1228 <td class="full" align="center">Clang 9</td>
1229 </tr>
1230 <tr>
1231 <td>Deprecate some problematic uses of <tt>volatile</tt></td>
1232 <td><a href="https://wg21.link/p1152r4">P1152R4</a></td>
1233 <td class="full" align="center">Clang 10</td>
1234 </tr>
1235 <tr>
1236 <td><tt>[[nodiscard("with reason")]]</tt></td>
1237 <td><a href="https://wg21.link/p1301r4">P1301R4</a></td>
1238 <td class="full" align="center">Clang 9</td>
1239 </tr>
1240 <tr>
1241 <td><tt>using enum</tt></td>
1242 <td><a href="https://wg21.link/p1099r5">P1099R5</a></td>
1243 <td class="full" align="center">Clang 13</td>
1244 </tr>
1245 <tr>
1246 <td rowspan=2>Class template argument deduction for aggregates</td>
1247 <td><a href="https://wg21.link/p1816r0">P1816R0</a></td>
1248 <td rowspan=2 class="none" align="center">No</td>
1249 </tr>
1250 <tr> <!-- from Prague -->
1251 <td><a href="https://wg21.link/p2082r1">P2082R1</a></td>
1252 </tr>
1253 <tr>
1254 <td>Class template argument deduction for alias templates</td>
1255 <td><a href="https://wg21.link/p1814r0">P1814R0</a></td>
1256 <td class="none" align="center">No</td>
1257 </tr>
1258 <tr>
1259 <td>Permit conversions to arrays of unknown bound</td>
1260 <td><a href="https://wg21.link/p0388r4">P0388R4</a></td>
1261 <td class="full" align="center">Clang 14</td>
1262 </tr>
1263 <tr>
1264 <td><tt>constinit</tt></td>
1265 <td><a href="https://wg21.link/p1143r2">P1143R2</a></td>
1266 <td class="full" align="center">Clang 10</td>
1267 </tr>
1268 <!-- Prague 2019 papers -->
1269 <tr>
1270 <td>Pseudo-destructors end object lifetimes</td>
1271 <td><a href="https://wg21.link/p0593r6">P0593R6</a> (<a href="#dr">DR</a>)</td>
1272 <td class="full" align="center">Clang 11</td>
1273 </tr>
1274 <tr>
1275 <td>More implicit moves</td>
1276 <td><a href="https://wg21.link/p1825r0">P1825R0</a> (<a href="#dr">DR</a>)</td>
1277 <td class="full" align="center">Clang 13</td>
1278 </tr>
1279 </table>
1282 <span id="p0482">(11): Prior to Clang 8, this feature is not enabled by
1283 <tt>-std=c++20</tt>, but can be enabled with <tt>-fchar8_t</tt>.
1284 </span>
1285 </p>
1286 </details>
1288 <h2 id="cxx23">C++2b implementation status</h2>
1290 <p>Clang has support for some of the features of the C++ standard following
1291 C++20, informally referred to as C++2b.</p>
1293 <p>You can use Clang in C++2b mode with the <code>-std=c++2b</code> option.</p>
1295 <details open>
1296 <summary>List of features and minimum Clang version with support</summary>
1298 <table width="689" border="1" cellspacing="0">
1299 <tr>
1300 <th>Language Feature</th>
1301 <th>C++2b Proposal</th>
1302 <th>Available in Clang?</th>
1303 </tr>
1304 <!-- Fall 2020 papers -->
1305 <tr>
1306 <td>Literal suffix <tt>uz</tt>, <tt>z</tt> for <tt>size_t</tt>, <tt>ssize_t</tt></td>
1307 <td><a href="https://wg21.link/p0330r8">P0330R8</a></td>
1308 <td class="full" align="center">Clang 13</td>
1309 </tr>
1310 <!-- Spring 2021 papers -->
1311 <tr>
1312 <td>Make <tt>()</tt> in lambdas optional in all cases</td>
1313 <td><a href="https://wg21.link/p1102r2">P1102R2</a></td>
1314 <td class="full" align="center">Clang 13</td>
1315 </tr>
1316 <tr>
1317 <td>Simpler implicit move</td>
1318 <td><a href="https://wg21.link/p2266r1">P2266R1</a></td>
1319 <td class="full" align="center">Clang 13</td>
1320 </tr>
1321 <tr>
1322 <td><tt>if consteval</tt></td>
1323 <td><a href="https://wg21.link/P1938R3">P1938R3</a></td>
1324 <td class="full" align="center">Clang 14</td>
1325 </tr>
1326 <tr>
1327 <td>Allow duplicate attributes</td>
1328 <td><a href="https://wg21.link/P2156R1">P2156R1</a></td>
1329 <td class="full" align="center">Clang 13</td>
1330 </tr>
1331 <tr>
1332 <td>Narrowing contextual conversions to bool</td>
1333 <td><a href="https://wg21.link/P1401R5">P1401R5</a></td>
1334 <td class="full" align="center">Clang 14</td>
1335 </tr>
1336 <tr>
1337 <td>Trimming whitespaces before line splicing</td>
1338 <td><a href="https://wg21.link/P2223R2">P2223R2</a></td>
1339 <td class="full" align="center">Yes</td>
1340 </tr>
1341 <tr>
1342 <td>Make declaration order layout mandated</td>
1343 <td><a href="https://wg21.link/p1847r4">P1874R4</a></td>
1344 <td class="full" align="center">Yes</td>
1345 </tr>
1346 <tr>
1347 <td>C++ identifier syntax using UAX 31</td>
1348 <td><a href="https://wg21.link/P1949R7">P1949R7</a></td>
1349 <td class="full" align="center">Clang 14</td>
1350 </tr>
1351 <tr>
1352 <td>Mixed string literal concatenation</td>
1353 <td><a href="https://wg21.link/p2201r1">P2201R1</a></td>
1354 <td class="full" align="center">Yes</td>
1355 </tr>
1356 <!-- October 2021 papers -->
1357 <tr>
1358 <td>Deducing this</td>
1359 <td><a href="https://wg21.link/P0847R7">P0847R7</a></td>
1360 <td class="none" align="center">No</td>
1361 </tr>
1362 <tr>
1363 <td rowspan=2>Change scope of lambda trailing-return-type</td>
1364 <td><a href="https://wg21.link/P2036R3">P2036R3</a></td>
1365 <td rowspan=2 class="none" align="center">No</td>
1366 </tr>
1367 <tr>
1368 <td><a href="https://wg21.link/P2579R0">P2579R0</a></td>
1369 </tr>
1370 <tr>
1371 <td>Multidimensional subscript operator</td>
1372 <td><a href="https://wg21.link/P2128R6">P2128R6</a></td>
1373 <td class="full" align="center">Clang 15</td>
1374 </tr>
1375 <tr>
1376 <td>Non-literal variables (and labels and gotos) in constexpr functions</td>
1377 <td><a href="https://wg21.link/P2242R3">P2242R3</a></td>
1378 <td class="full" align="center">Clang 15</td>
1379 </tr>
1380 <tr>
1381 <td>Character encoding of diagnostic text</td>
1382 <td><a href="https://wg21.link/P2246R1">P2246R1</a></td>
1383 <td class="full" align="center">Yes</td>
1384 </tr>
1385 <tr>
1386 <td>Character sets and encodings</td>
1387 <td><a href="https://wg21.link/P2314R4">P2314R4</a></td>
1388 <td class="full" align="center">Yes</td>
1389 </tr>
1390 <tr>
1391 <td>Consistent character literal encoding</td>
1392 <td><a href="https://wg21.link/P2316R2">P2316R2</a></td>
1393 <td class="full" align="center">Yes</td>
1394 </tr>
1395 <tr>
1396 <td>Add support for preprocessing directives elifdef and elifndef</td>
1397 <td><a href="https://wg21.link/P2334R1">P2334R1</a></td>
1398 <td class="full" align="center">Clang 13</td>
1399 </tr>
1400 <tr>
1401 <td>Extend init-statement to allow alias-declaration</td>
1402 <td><a href="https://wg21.link/P2360R0">P2360R0</a></td>
1403 <td class="full" align="center">Clang 14</td>
1404 </tr>
1405 <tr>
1406 <td>auto(x): decay-copy in the language</td>
1407 <td><a href="https://wg21.link/P0849R8">P0849R8</a></td>
1408 <td class="full" align="center">Clang 15</td>
1409 </tr>
1410 <!-- February 2022 papers -->
1411 <tr>
1412 <td>Attributes on Lambda-Expressions</td>
1413 <td><a href="https://wg21.link/P2173R1">P2173R1</a></td>
1414 <td class="full" align="center">Clang 13</td>
1415 </tr>
1416 <tr>
1417 <td><tt>constexpr</tt> for <tt>&lt;cmath&gt;</tt> and <tt>&lt;cstdlib&gt;</tt></td>
1418 <td><a href="https://wg21.link/P0533R9">P0533R9</a></td>
1419 <td class="none" align="center">No</td>
1420 </tr>
1421 <tr>
1422 <td>Type trait to determine if a reference binds to a temporary</td>
1423 <td><a href="https://wg21.link/P2255R2">P2255R2</a></td>
1424 <td class="partial" align="center">
1425 <details><summary>Partial</summary>
1426 Clang provides a <tt>__reference_binds_to_temporary</tt> type trait
1427 builtin, with which the library facility can be partially implemented.
1428 Both <tt>__reference_constructs_from_temporary</tt> and
1429 <tt>__reference_converts_from_temporary</tt> builtins should be
1430 provided, following the normal cross-vendor convention to implement
1431 traits requiring compiler support directly.
1432 </details></td>
1433 </td>
1434 </tr>
1435 <!-- July 2022 papers -->
1436 <tr>
1437 <td>The Equality Operator You Are Looking For</td>
1438 <td><a href="https://wg21.link/P2468R2">P2468R2</a></td>
1439 <td class="none" align="center">No</td>
1440 </tr>
1441 <tr>
1442 <td>De-deprecating volatile compound operations</td>
1443 <td><a href="https://wg21.link/P2327R1">P2327R1</a></td>
1444 <td class="full" align="center">Clang 15</td>
1445 </tr>
1446 <tr>
1447 <td>Support for <code>#warning</code></td>
1448 <td><a href="https://wg21.link/P2437R1">P2437R1</a></td>
1449 <td class="full" align="center">Yes</td>
1450 </tr>
1451 <tr>
1452 <td>Remove non-encodable wide character literals and multicharacter wide character literals</td>
1453 <td><a href="https://wg21.link/P2362R3">P2362R3</a></td>
1454 <td class="full" align="center">Clang 14</td>
1455 </tr>
1456 <tr>
1457 <td>Labels at the end of compound statements</td>
1458 <td><a href="https://wg21.link/P2324R2">P2324R2</a></td>
1459 <td class="unreleased" align="center">Clang 16</td>
1460 </tr>
1461 <tr>
1462 <td>Delimited escape sequences</td>
1463 <td><a href="https://wg21.link/P2290R3">P2290R3</a></td>
1464 <td class="full" align="center">Clang 15</td>
1465 </tr>
1466 <tr>
1467 <td>Named universal character escapes</td>
1468 <td><a href="https://wg21.link/P2071R2">P2071R2</a></td>
1469 <td class="full" align="center">Clang 15</td>
1470 </tr>
1471 <tr>
1472 <td>Relaxing some constexpr restrictions</td>
1473 <td><a href="https://wg21.link/P2448R2">P2448R2</a></td>
1474 <td class="none" align="center">No</td>
1475 </tr>
1476 <tr>
1477 <td>Using unknown pointers and references in constant expressions</td>
1478 <td><a href="https://wg21.link/P2280R4">P2280R4</a></td>
1479 <td class="none" align="center">No</td>
1480 </tr>
1481 <tr>
1482 <td>static <code>operator()</code></td>
1483 <td><a href="https://wg21.link/P1169R4">P1169R4</a></td>
1484 <td class="none" align="center">No</td>
1485 </tr>
1486 <tr>
1487 <td>Extended floating-point types and standard names</td>
1488 <td><a href="https://wg21.link/P1467R9">P1467R9</a></td>
1489 <td class="none" align="center">No</td>
1490 </tr>
1491 <tr>
1492 <td>Class template argument deduction from inherited constructors</td>
1493 <td><a href="https://wg21.link/P2582R1">P2582R1</a></td>
1494 <td class="none" align="center">No</td>
1495 </tr>
1496 <tr>
1497 <td>Portable assumptions</td>
1498 <td><a href="https://wg21.link/P1774R8">P1774R8</a></td>
1499 <td class="none" align="center">No</td>
1500 </tr>
1501 <tr>
1502 <td>Support for UTF-8 as a portable source file encoding</td>
1503 <td><a href="https://wg21.link/P2295R6">P2295R6</a></td>
1504 <td class="full" align="center">Clang 15</td>
1505 </tr>
1506 <tr>
1507 <td><code>char8_t</code> Compatibility and Portability Fix</td>
1508 <td><a href="https://wg21.link/P2513R3">P2513R3</a></td>
1509 <td class="none" align="center">No</td>
1510 </tr>
1511 <tr>
1512 <td>Relax requirements on <code>wchar_t</code> to match existing practices</td>
1513 <td><a href="https://wg21.link/P2460R2">P2460R2</a></td>
1514 <td class="full" align="center">Yes</td>
1515 </tr>
1516 <tr>
1517 <td>Explicit lifetime management</td>
1518 <td><a href="https://wg21.link/P2590R2">P2590R2</a></td>
1519 <td class="none" align="center">No</td>
1520 </tr>
1522 </table>
1523 </details>
1525 <h2 id="dr">Defect reports</h2>
1527 <p>Clang generally aims to implement resolutions to Defect Reports (bug fixes
1528 against prior standards) retroactively, in all prior standard versions where
1529 the fix is meaningful. Significant Defect Report changes to language features
1530 after the publication of the relevant standard are marked (DR) in the above
1531 table.</p>
1533 <p>Clang also has a test suite for conformance to resolutions for issues on the
1534 <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_toc.html">C++ core issues list</a>,
1535 most of which are considered Defect Reports.
1536 <a href="cxx_dr_status.html">Implementation status for C++ core issues</a> based on
1537 that test suite is tracked on a separate page.</p>
1539 <h2 id="ts">Technical specifications and standing documents</h2>
1541 <p>ISO C++ also publishes a number of documents describing additional language
1542 and library features that are not part of standard C++.</p>
1544 <details open>
1545 <summary>List of features and minimum Clang version with support</summary>
1547 <table width="689" border="1" cellspacing="0">
1548 <tr>
1549 <th>Document</th>
1550 <th>Latest draft</th>
1551 <th>Compiler flag</th>
1552 <th>Available in Clang?</th>
1553 </tr>
1554 <tr id="sd6">
1555 <td rowspan="7">SD-6: SG10 feature test recommendations</td>
1556 <td rowspan="7"><a href="https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations">SD-6</a></td>
1557 <td rowspan="7">N/A</td>
1558 <td class="full" align="center">
1559 Clang 3.4 (<a href="https://wg21.link/n3745">N3745</a>)</br>
1560 </td>
1561 </tr>
1562 <tr>
1563 <td class="full" align="center">
1564 Clang 3.6 (<a href="https://wg21.link/n4200">N4200</a>)</a>
1565 </td>
1566 </tr>
1567 <tr>
1568 <td class="full" align="center">
1569 Clang 4 (<a href="https://wg21.link/p0096r3">P0096R3</a>)</a>
1570 </td>
1571 </tr>
1572 <tr>
1573 <td class="full" align="center">
1574 Clang 5 (<a href="https://wg21.link/p0096r4">P0096R4</a>)</a>
1575 </td>
1576 </tr>
1577 <tr>
1578 <td class="full" align="center">
1579 Clang 7 (<a href="https://wg21.link/p0096r5">P0096R5</a>)</a>
1580 </td>
1581 </tr>
1582 <tr>
1583 <td class="full" align="center">
1584 Clang 9 (<a href="https://wg21.link/p1353r0">P1353R0</a>)
1585 </td>
1586 </tr>
1587 <tr>
1588 <td class="full" align="center">
1589 Clang 10 (<a href="https://wg21.link/p1902r1">P1902R1</a>)</a>
1590 </td>
1591 </tr>
1592 <!-- No compiler support is known to be needed for:
1593 * Concurrency TS
1594 * Parallelism TS (v1, v2)
1595 * Ranges TS
1596 * Networking TS
1597 * File System TS
1599 <tr>
1600 <td>[TS] Concepts</td>
1601 <td><a href="https://wg21.link/p0121r0">P0121R0</a></td>
1602 <td></td>
1603 <td class="na" align="center">Superseded by <a href="#p0734">P0734R0</a></td>
1604 </tr>
1605 <tr>
1606 <!-- track unimplemented Coroutines features: p0913r1 p0914r1 p1356r0 -->
1607 <td rowspan="2">[TS] Coroutines</td>
1608 <td rowspan="2"><a href="https://isocpp.org/files/papers/N4663.pdf">N4663</a></td>
1609 <td><tt>-fcoroutines-ts<br>-stdlib=libc++</tt></td>
1610 <td class="full" align="center">Clang 5</td>
1611 </tr>
1612 <tr>
1613 <td><tt>-std=c++20<br>-stdlib=libc++</tt></td>
1614 <td class="na" align="center">Superseded by <a href="#p0912">P0912R5</a></td>
1615 </tr>
1616 <tr>
1617 <td>[TS] Library Fundamentals, Version 1 (invocation type traits)</td>
1618 <td><a href="https://wg21.link/n4480">N4480</a></td>
1619 <td>N/A</td>
1620 <td class="none" align="center">No</td>
1621 </tr>
1622 <tr>
1623 <td>[TS] Library Fundamentals, Version 2 (<tt>source_location</tt>)</td>
1624 <td><a href="https://wg21.link/n4617">N4617</a></td>
1625 <td>N/A</td>
1626 <td class="full" align="center">Clang 9 (<a href="docs/LanguageExtensions.html#source-location-builtins">documentation</a>)</td>
1627 </tr>
1628 <tr>
1629 <td>[TS] Modules</td>
1630 <td><a href="https://wg21.link/n4720">N4720</a></td>
1631 <td><tt>-fmodules-ts</tt></td>
1632 <td class="na" align="center">Superseded by <a href="#p1103">P1103R3</a></td>
1633 </tr>
1634 <tr>
1635 <td>[DRAFT TS] Reflection</td>
1636 <td><a href="https://wg21.link/n4818">N4818</a></td>
1637 <td></td>
1638 <td class="none" align="center">No</td>
1639 </tr>
1640 <tr>
1641 <td>[TS] Transactional Memory</td>
1642 <td><a href="https://wg21.link/n4514">N4514</a></td>
1643 <td></td>
1644 <td class="none" align="center">No</td>
1645 </tr>
1646 </table>
1647 </details>
1649 </div>
1650 </body>
1651 </html>