1<!DOCTYPE html> 2<html> 3<head> 4 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 5 <title>Clang - C++20, C++17, C++14, C++11 and C++98 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> 21 22<!--#include virtual="menu.html.incl"--> 23 24<div id="content"> 25 26<!--*************************************************************************--> 27<h1>C++ Support in Clang</h1> 28<!--*************************************************************************--> 29 30<p>Clang implements the following published and upcoming ISO C++ standards:</p> 31 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> 69 70<p>The Clang community is continually striving to improve C++ standards 71compliance between releases by submitting and tracking <a 72href="cxx_dr_status.html">C++ Defect Reports</a> and implementing resolutions 73as they become available.</p> 74 75<p>Experimental work is also under way to implement <a href="#ts">C++ Technical 76Specifications</a> that will help drive the future of the C++ programming 77language.</p> 78 79<p>The <a href="https://bugs.llvm.org/">LLVM bug tracker</a> contains Clang 80C++ components that track known bugs with Clang's language conformance in 81each language mode.</p> 82 83<h2 id="cxx98">C++98 implementation status</h2> 84 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). 88 89<h2 id="cxx11">C++11 implementation status</h2> 90 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> 94 95<p>You can use Clang in C++11 mode with the <code>-std=c++11</code> 96option. Clang's C++11 mode can be used with 97<a href="https://libcxx.llvm.org/">libc++</a> or with gcc's libstdc++.</p> 98 99<details> 100<summary>List of features and minimum Clang version with support</summary> 101 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="unreleased" align="center">Clang 13</td> 115 </tr> 116 </tr> 117 <tr> 118 <td> 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> 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> 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> 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> 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> 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> 393 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> 417 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> 448 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> 473 474<p> 475<span id="n2761">(1): The <code>[[carries_dependency]]</code> attribute 476has no effect.</span><br> 477<span id="n2670">(2): No compiler changes are required for an implementation 478such as Clang that does not provide garbage collection.</span><br> 479<span id="n2748">(3): All compare-exchange operations are emitted as 480strong 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 484requires a C++ runtime library providing <code>__cxa_thread_atexit</code>, such 485as <a href="https://libcxxabi.llvm.org">libc++abi</a> 3.6 or later, 486or libsupc++ 4.8 or later.</span><br> 487<span id="n1988">(6): No compiler changes are required for an implementation 488such as Clang that does not provide any extended integer types. 489<code>__int128</code> is not treated as an extended integer type, 490because changing <code>intmax_t</code> would be an ABI-incompatible 491change.</span> 492</p> 493</details> 494 495<h2 id="cxx14">C++14 implementation status</h2> 496 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> 500 501<p>By default, Clang builds C++ code according to the C++14 standard. 502You 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> 504 505<details> 506<summary>List of features and minimum Clang version with support</summary> 507 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> 579 580<p> 581<span id="n3778">(7): In Clang 3.7 and later, sized deallocation is only enabled 582if the user passes the <code>-fsized-deallocation</code> flag. The user must 583supply definitions of the sized deallocation functions, either by providing them 584explicitly or by using a C++ standard library that does. <code>libstdc++</code> 585added these functions in version 5.0, and <code>libc++</code> added them in 586version 3.7. 587</span> 588</p> 589</details> 590 591<h2 id="cxx17">C++17 implementation status</h2> 592 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> 595 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> 598 599<details open> 600<summary>List of features and minimum Clang version with support</summary> 601 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> 830 831<p> 832<span id="n3922">(8): This is a backwards-incompatible change that is applied to 833all language versions that allow type deduction from <tt>auto</tt> 834(per the request of the C++ committee). 835In 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 838left to right in the callee. As a result, function parameters in calls to 839<tt>operator<<</tt>, <tt>operator>></tt>, <tt>operator->*</tt>, 840<tt>operator&&</tt>, <tt>operator||</tt>, and <tt>operator,</tt> 841functions using expression syntax are no longer guaranteed to be destroyed in 842reverse construction order in that ABI. 843This 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 846feature is disabled by default in all language versions, and can be enabled 847explicitly with the flag <tt>-frelaxed-template-template-args</tt> in Clang 4 848onwards. 849The change to the standard lacks a corresponding change for template partial 850ordering, resulting in ambiguity errors for reasonable and previously-valid 851code. This issue is expected to be rectified soon. 852</span> 853</p> 854</details> 855 856<h2 id="cxx20">C++20 implementation status</h2> 857 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> 860 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> 863 864<details open> 865<summary>List of features and minimum Clang version with support</summary> 866 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&</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="12">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">Partial</td> 916 </tr> 917 <tr> <!-- from San Diego --> 918 <td><a href="https://wg21.link/p1084r2">P1084R2</a></td> 919 <td rowspan="2" class="full" align="center">Clang 10</td> 920 </tr> 921 <tr> 922 <td><a href="https://wg21.link/p1141r2">P1141R2</a></td> 923 </tr> 924 <tr> <!-- from Cologne --> 925 <td><a href="https://wg21.link/p0848r3">P0848R3</a></td> 926 <td rowspan="1" class="none" align="center">No</td> 927 </tr> 928 <tr> 929 <td><a href="https://wg21.link/p1616r1">P1616R1</a></td> 930 <td rowspan="2" class="full" align="center">Clang 10</td> 931 </tr> 932 <tr> 933 <td><a href="https://wg21.link/p1452r2">P1452R2</a></td> 934 </tr> 935 <tr> <!-- from Belfast --> 936 <td><a href="https://wg21.link/p1972r0">P1972R0</a></td> 937 <td rowspan="5" class="none" align="center">No</td> 938 </tr> 939 <tr> 940 <td><a href="https://wg21.link/p1980r0">P1980R0</a></td> 941 </tr> 942 <tr> <!-- from Prague --> 943 <td><a href="https://wg21.link/p2103r0">P2103R0</a></td> 944 </tr> 945 <tr> 946 <td><a href="https://wg21.link/p2092r0">P2092R0</a></td> 947 </tr> 948 <tr> 949 <td><a href="https://wg21.link/p2113r0">P2113R0</a></td> 950 </tr> 951 <!-- Albuquerque papers --> 952 <tr> 953 <td>Range-based for statements with initializer</td> 954 <td><a href="https://wg21.link/p0614r1">P0614R1</a></td> 955 <td class="full" align="center">Clang 8</td> 956 </tr> 957 <tr> 958 <td>ADL and function templates that are not visible</td> 959 <td><a href="https://wg21.link/p0846r0">P0846R0</a></td> 960 <td class="full" align="center">Clang 9</td> 961 </tr> 962 <tr> 963 <td><tt>const</tt> mismatch with defaulted copy constructor</td> 964 <td><a href="https://wg21.link/p0641r2">P0641R2</a></td> 965 <td class="full" align="center">Clang 8</td> 966 </tr> 967 <tr> 968 <td rowspan="10">Consistent comparison (<tt>operator<=></tt>)</td> 969 <td><a href="https://wg21.link/p0515r3">P0515R3</a></td> 970 <td rowspan="8" class="full" align="center">Clang 10</td> 971 </tr> 972 <tr> <!-- from Jacksonville --> 973 <td><a href="https://wg21.link/p0905r1">P0905R1</a></td> 974 </tr> 975 <tr> <!-- from Rapperswil --> 976 <td><a href="https://wg21.link/p1120r0">P1120R0</a></td> 977 </tr> 978 <tr> <!-- from Kona 2019 --> 979 <td><a href="https://wg21.link/p1185r2">P1185R2</a></td> 980 </tr> 981 <tr> <!-- from Cologne --> 982 <td><a href="https://wg21.link/p1186r3">P1186R3</a></td> 983 </tr> 984 <tr> 985 <td><a href="https://wg21.link/p1630r1">P1630R1</a></td> 986 </tr> 987 <tr> <!-- from Belfast --> 988 <td><a href="https://wg21.link/p1946r0">P1946R0</a></td> 989 </tr> 990 <tr> 991 <td><a href="https://wg21.link/p1959r0">P1959R0</a></td> 992 </tr> 993 <tr> <!-- from Prague --> 994 <td><a href="https://wg21.link/p2002r1">P2002R1</a></td> 995 <td class="partial" align="center">Partial</td> 996 </tr> 997 <tr> 998 <td><a href="https://wg21.link/p2085r0">P2085R0</a></td> 999 <td class="none" align="center">No</td> 1000 </tr> 1001 <tr> 1002 <td>Access checking on specializations</td> 1003 <td><a href="https://wg21.link/p0692r1">P0692R1</a></td> 1004 <td class="partial" align="center">Partial</td> 1005 </tr> 1006 <tr> 1007 <td>Default constructible and assignable stateless lambdas</td> 1008 <td><a href="https://wg21.link/p0624r2">P0624R2</a></td> 1009 <td class="full" align="center">Clang 8</td> 1010 </tr> 1011 <tr> 1012 <td>Lambdas in unevaluated contexts</td> 1013 <td><a href="https://wg21.link/p0315r4">P0315R4</a></td> 1014 <td class="partial" align="center">Clang 13</td> 1015 </tr> 1016 <!-- Jacksonville papers --> 1017 <tr> 1018 <td><tt>[[no_unique_address]]</tt> attribute</td> 1019 <td><a href="https://wg21.link/p0840r2">P0840R2</a></td> 1020 <td class="full" align="center">Clang 9</td> 1021 </tr> 1022 <tr> 1023 <td><tt>[[likely]]</tt> and <tt>[[unlikely]]</tt> attributes</td> 1024 <td><a href="https://wg21.link/p0479r5">P0479R5</a></td> 1025 <td class="full" align="center">Clang 12</td> 1026 </tr> 1027 <tr> 1028 <td><tt>typename</tt> optional in more contexts</td> 1029 <td><a href="https://wg21.link/p0634r3">P0634R3</a></td> 1030 <td class="none" align="center">No</td> 1031 </tr> 1032 <tr> 1033 <td>Pack expansion in lambda <i>init-capture</i></td> 1034 <td><a href="https://wg21.link/p0780r2">P0780R2</a></td> 1035 <td class="full" align="center">Clang 9</td> 1036 </tr> 1037 <!-- Rapperswil papers --> 1038 <tr> 1039 <td rowspan="2">Class types as non-type template parameters</td> 1040 <td><a href="https://wg21.link/p0732r2">P0732R2</a></td> 1041 <td rowspan="2" class="partial" align="center">Partial</td> 1042 </tr> 1043 <tr> <!-- from Belfast --> 1044 <td><a href="https://wg21.link/p1907r1">P1907R1</a></td> 1045 </tr> 1046 <tr> 1047 <td>Destroying operator delete</td> 1048 <td><a href="https://wg21.link/p0722r3">P0722R3</a></td> 1049 <td class="full" align="center">Clang 6</td> 1050 </tr> 1051 <tr> 1052 <td rowspan="7">Relaxations of <tt>constexpr</tt> restrictions</td> 1053 <td><a href="https://wg21.link/p1064r0">P1064R0</a></td> 1054 <td class="full" align="center">Clang 9</td> 1055 </tr> 1056 <tr> <!-- from San Diego --> 1057 <td><a href="https://wg21.link/p1002r1">P1002R1</a></td> 1058 <td class="full" align="center">Clang 8</td> 1059 </tr> 1060 <tr> 1061 <td><a href="https://wg21.link/p1327r1">P1327R1</a></td> 1062 <td rowspan="2" class="full" align="center">Clang 9</td> 1063 </tr> 1064 <tr> 1065 <td><a href="https://wg21.link/p1330r0">P1330R0</a></td> 1066 </tr> 1067 <tr> <!-- from Cologne --> 1068 <td><a href="https://wg21.link/p1331r2">P1331R2</a></td> 1069 <td rowspan="3" class="full" align="center">Clang 10</td> 1070 </tr> 1071 <tr> 1072 <td><a href="https://wg21.link/p1668r1">P1668R1</a></td> 1073 </tr> 1074 <tr> 1075 <td><a href="https://wg21.link/p0784r7">P0784R7</a></td> 1076 </tr> 1077 <tr> 1078 <td>Prohibit aggregates with user-declared constructors</td> 1079 <td><a href="https://wg21.link/p1008r1">P1008R1</a></td> 1080 <td class="full" align="center">Clang 8</td> 1081 </tr> 1082 <tr> 1083 <td>Feature test macros</td> 1084 <td><a href="https://wg21.link/p0941r2">P0941R2</a></td> 1085 <td class="full" align="center"><a href="#sd6">(see below)</a></td> 1086 </tr> 1087 <tr> 1088 <td><tt>explicit(bool)</tt></td> 1089 <td><a href="https://wg21.link/p0892r2">P0892R2</a></td> 1090 <td class="full" align="center">Clang 9</td> 1091 </tr> 1092 <!-- San Diego papers --> 1093 <tr> 1094 <td>Signed integers are two's complement</td> 1095 <td><a href="https://wg21.link/p1236r1">P1236R1</a></td> 1096 <td class="full" align="center">Clang 9</td> 1097 </tr> 1098 <tr> 1099 <td><tt>char8_t</tt></td> 1100 <td><a href="https://wg21.link/p0482r6">P0482R6</a></td> 1101 <td class="full" align="center">Clang 7 <a href="#p0482">(11)</a></td> 1102 </tr> 1103 <tr> 1104 <td rowspan=2>Immediate functions (<tt>consteval</tt>)</td> 1105 <td><a href="https://wg21.link/p1073r3">P1073R3</a></td> 1106 <td rowspan=2 class="none" align="center">No</td> 1107 </tr> 1108 <tr> <!-- from Prague --> 1109 <td><a href="https://wg21.link/p1937r2">P1937R2</a></td> 1110 </tr> 1111 <tr> 1112 <td><tt>std::is_constant_evaluated</tt></td> 1113 <td><a href="https://wg21.link/p0595r2">P0595R2</a></td> 1114 <td class="full" align="center">Clang 9</td> 1115 </tr> 1116 <tr> 1117 <td>Nested inline namespaces</td> 1118 <td><a href="https://wg21.link/p1094r2">P1094R2</a></td> 1119 <td class="full" align="center">Clang 8</td> 1120 </tr> 1121 <!-- Kona 2019 papers --> 1122 <tr> 1123 <td rowspan="2">Structured binding extensions</td> 1124 <td><a href="https://wg21.link/p1091r3">P1091R3</a></td> 1125 <td rowspan="2" class="partial" align="center">Partial</td> 1126 </tr> 1127 <tr> 1128 <td><a href="https://wg21.link/p1381r1">P1381R1</a></td> 1129 </tr> 1130 <tr> 1131 <td rowspan="2">Stronger Unicode requirements</td> 1132 <td><a href="https://wg21.link/p1041r4">P1041R4</a></td> 1133 <td rowspan="2" class="full" align="center">Yes</td> 1134 </tr> 1135 <tr> 1136 <td><a href="https://wg21.link/p1139r2">P1139R2</a></td> 1137 </tr> 1138 <tr> 1139 <td rowspan="2">Parenthesized initialization of aggregates</td> 1140 <td><a href="https://wg21.link/p0960r3">P0960R3</a></td> 1141 <td rowspan="2" class="none" align="center">No</td> 1142 </tr> 1143 <tr> <!-- from Belfast --> 1144 <td><a href="https://wg21.link/p1975r0">P1975R0</a></td> 1145 </tr> 1146 <tr> 1147 <td rowspan="10">Modules</td> 1148 <td><a href="https://wg21.link/p1103r3">P1103R3</a></td> 1149 <td class="partial" align="center">Partial</td> 1150 </tr> 1151 <tr> <!-- from Cologne --> 1152 <td><a href="https://wg21.link/p1766r1">P1766R1</a> (<a href="#dr">DR</a>)</td> 1153 <td class="full" align="center">Clang 11</td> 1154 </tr> 1155 <tr> 1156 <td><a href="https://wg21.link/p1811r0">P1811R0</a></td> 1157 <td rowspan="2" class="none" align="center">No</td> 1158 </tr> 1159 <tr> 1160 <td><a href="https://wg21.link/p1703r1">P1703R1</a></td> 1161 </tr> 1162 <tr> <!-- from Belfast --> 1163 <td><a href="https://wg21.link/p1874r1">P1874R1</a></td> 1164 <td class="partial" align="center">Partial</td> 1165 </tr> 1166 <tr> <!-- from Belfast --> 1167 <td><a href="https://wg21.link/p1979r0">P1979R0</a></td> 1168 <td rowspan="3" class="none" align="center">No</td> 1169 </tr> 1170 <tr> <!-- from Prague --> 1171 <td><a href="https://wg21.link/p1779r3">P1779R3</a></td> 1172 </tr> 1173 <tr> 1174 <td><a href="https://wg21.link/p1857r3">P1857R3</a></td> 1175 </tr> 1176 <tr> 1177 <td><a href="https://wg21.link/p2115r0">P2115R0</a></td> 1178 <td class="partial" align="center">Partial</td> 1179 </tr> 1180 <tr> 1181 <td><a href="https://wg21.link/p1815r2">P1815R2</a></td> 1182 <td class="none" align="center">No</td> 1183 </tr> 1184 <tr> 1185 <td>Coroutines</td> 1186 <td><a href="https://wg21.link/p0912r5">P0912R5</a></td> 1187 <td class="partial" align="center">Partial</td> 1188 </tr> 1189 <!-- Cologne 2019 papers --> 1190 <tr> 1191 <td>Deprecate <tt>a[b,c]</tt></td> 1192 <td><a href="https://wg21.link/p1161r3">P1161R3</a></td> 1193 <td class="full" align="center">Clang 9</td> 1194 </tr> 1195 <tr> 1196 <td>Deprecate some problematic uses of <tt>volatile</tt></td> 1197 <td><a href="https://wg21.link/p1152r4">P1152R4</a></td> 1198 <td class="full" align="center">Clang 10</td> 1199 </tr> 1200 <tr> 1201 <td><tt>[[nodiscard("with reason")]]</tt></td> 1202 <td><a href="https://wg21.link/p1301r4">P1301R4</a></td> 1203 <td class="full" align="center">Clang 9</td> 1204 </tr> 1205 <tr> 1206 <td><tt>using enum</tt></td> 1207 <td><a href="https://wg21.link/p1099r5">P1099R5</a></td> 1208 <td class="unreleased" align="center">Clang 13</td> 1209 </tr> 1210 <tr> 1211 <td rowspan=2>Class template argument deduction for aggregates</td> 1212 <td><a href="https://wg21.link/p1816r0">P1816R0</a></td> 1213 <td rowspan=2 class="none" align="center">No</td> 1214 </tr> 1215 <tr> <!-- from Prague --> 1216 <td><a href="https://wg21.link/p2082r1">P2082R1</a></td> 1217 </tr> 1218 <tr> 1219 <td>Class template argument deduction for alias templates</td> 1220 <td><a href="https://wg21.link/p1814r0">P1814R0</a></td> 1221 <td class="none" align="center">No</td> 1222 </tr> 1223 <tr> 1224 <td>Permit conversions to arrays of unknown bound</td> 1225 <td><a href="https://wg21.link/p0388r4">P0388R4</a></td> 1226 <td class="none" align="center">No</td> 1227 </tr> 1228 <tr> 1229 <td><tt>constinit</tt></td> 1230 <td><a href="https://wg21.link/p1143r2">P1143R2</a></td> 1231 <td class="full" align="center">Clang 10</td> 1232 </tr> 1233 <!-- Prague 2019 papers --> 1234 <tr> 1235 <td>Pseudo-destructors end object lifetimes</td> 1236 <td><a href="https://wg21.link/p0593r6">P0593R6</a> (<a href="#dr">DR</a>)</td> 1237 <td class="full" align="center">Clang 11</td> 1238 </tr> 1239 <tr> 1240 <td>More implicit moves</td> 1241 <td><a href="https://wg21.link/p1825r0">P1825R0</a> (<a href="#dr">DR</a>)</td> 1242 <td class="unreleased" align="center">Clang 13</td> 1243 </tr> 1244</table> 1245 1246<p> 1247<span id="p0482">(11): Prior to Clang 8, this feature is not enabled by 1248<tt>-std=c++20</tt>, but can be enabled with <tt>-fchar8_t</tt>. 1249</span> 1250</p> 1251</details> 1252 1253<h2 id="cxx23">C++2b implementation status</h2> 1254 1255<p>Clang has support for some of the features of the C++ standard following 1256C++20, informally referred to as C++2b.</p> 1257 1258<p>You can use Clang in C++2b mode with the <code>-std=c++2b</code> option.</p> 1259 1260<details open> 1261<summary>List of features and minimum Clang version with support</summary> 1262 1263<table width="689" border="1" cellspacing="0"> 1264 <tr> 1265 <th>Language Feature</th> 1266 <th>C++2b Proposal</th> 1267 <th>Available in Clang?</th> 1268 </tr> 1269 <!-- Fall 2020 papers --> 1270 <tr> 1271 <td>Literal suffix <tt>uz</tt>, <tt>z</tt> for <tt>size_t</tt>, <tt>ssize_t</tt></td> 1272 <td><a href="https://wg21.link/p0330r8">P0330R8</a></td> 1273 <td class="unreleased" align="center">Clang 13</td> 1274 </tr> 1275 <!-- Spring 2021 papers --> 1276 <tr> 1277 <td>Make <tt>()</tt> in lambdas optional in all cases</td> 1278 <td><a href="https://wg21.link/p1102r2">P1102R2</a></td> 1279 <td class="unreleased" align="center">Clang 13</td> 1280 </tr> 1281 <tr> 1282 <td>Simpler implicit move</td> 1283 <td><a href="https://wg21.link/p2266r1">P2266R1</a></td> 1284 <td class="unreleased" align="center">Clang 13</td> 1285 </tr> 1286 <tr> 1287 <td><tt>if consteval</tt></td> 1288 <td><a href="https://wg21.link/P1938R3">P1938R3</a></td> 1289 <td class="none" align="center">No</td> 1290 </tr> 1291 <tr> 1292 <td>Allow duplicate attributes</td> 1293 <td><a href="https://wg21.link/P2156R1">P2156R1</a></td> 1294 <td class="unreleased" align="center">Clang 13</td> 1295 </tr> 1296 <tr> 1297 <td>Narrowing contextual conversions to bool</td> 1298 <td><a href="https://wg21.link/P1401R5">P1401R5</a></td> 1299 <td class="partial" align="center">Clang 13</td> 1300 </tr> 1301 <tr> 1302 <td>Trimming whitespaces before line splicing</td> 1303 <td><a href="https://wg21.link/P2223R2">P2223R2</a></td> 1304 <td class="full" align="center">Yes</td> 1305 </tr> 1306 <tr> 1307 <td>Make declaration order layout mandated</td> 1308 <td><a href="https://wg21.link/p1847r4">P1874R4</a></td> 1309 <td class="full" align="center">Yes</td> 1310 </tr> 1311 <tr> 1312 <td>C++ identifier syntax using UAX 31</td> 1313 <td><a href="https://wg21.link/P1949R7">P1949R7</a></td> 1314 <td class="none" align="center">No</td> 1315 </tr> 1316 <tr> 1317 <td>Mixed string literal concatenation</td> 1318 <td><a href="https://wg21.link/p2201r1">P2201R1</a></td> 1319 <td class="full" align="center">Yes</td> 1320 </tr> 1321</table> 1322</details> 1323 1324<h2 id="dr">Defect reports</h2> 1325 1326<p>Clang generally aims to implement resolutions to Defect Reports (bug fixes 1327against prior standards) retroactively, in all prior standard versions where 1328the fix is meaningful. Significant Defect Report changes to language features 1329after the publication of the relevant standard are marked (DR) in the above 1330table.</p> 1331 1332<p>Clang also has a test suite for conformance to resolutions for issues on the 1333<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_toc.html">C++ core issues list</a>, 1334most of which are considered Defect Reports. 1335<a href="cxx_dr_status.html">Implementation status for C++ core issues</a> based on 1336that test suite is tracked on a separate page.</p> 1337 1338<h2 id="ts">Technical specifications and standing documents</h2> 1339 1340<p>ISO C++ also publishes a number of documents describing additional language 1341and library features that are not part of standard C++.</p> 1342 1343<details open> 1344<summary>List of features and minimum Clang version with support</summary> 1345 1346<table width="689" border="1" cellspacing="0"> 1347 <tr> 1348 <th>Document</th> 1349 <th>Latest draft</th> 1350 <th>Compiler flag</th> 1351 <th>Available in Clang?</th> 1352 </tr> 1353 <tr id="sd6"> 1354 <td rowspan="7">SD-6: SG10 feature test recommendations</td> 1355 <td rowspan="7"><a href="https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations">SD-6</a></td> 1356 <td rowspan="7">N/A</td> 1357 <td class="full" align="center"> 1358 Clang 3.4 (<a href="https://wg21.link/n3745">N3745</a>)</br> 1359 </td> 1360 </tr> 1361 <tr> 1362 <td class="full" align="center"> 1363 Clang 3.6 (<a href="https://wg21.link/n4200">N4200</a>)</a> 1364 </td> 1365 </tr> 1366 <tr> 1367 <td class="full" align="center"> 1368 Clang 4 (<a href="https://wg21.link/p0096r3">P0096R3</a>)</a> 1369 </td> 1370 </tr> 1371 <tr> 1372 <td class="full" align="center"> 1373 Clang 5 (<a href="https://wg21.link/p0096r4">P0096R4</a>)</a> 1374 </td> 1375 </tr> 1376 <tr> 1377 <td class="full" align="center"> 1378 Clang 7 (<a href="https://wg21.link/p0096r5">P0096R5</a>)</a> 1379 </td> 1380 </tr> 1381 <tr> 1382 <td class="full" align="center"> 1383 Clang 9 (<a href="https://wg21.link/p1353r0">P1353R0</a>) 1384 </td> 1385 </tr> 1386 <tr> 1387 <td class="full" align="center"> 1388 Clang 10 (<a href="https://wg21.link/p1902r1">P1902R1</a>)</a> 1389 </td> 1390 </tr> 1391 <!-- No compiler support is known to be needed for: 1392 * Concurrency TS 1393 * Parallelism TS (v1, v2) 1394 * Ranges TS 1395 * Networking TS 1396 * File System TS 1397 --> 1398 <tr> 1399 <td>[TS] Concepts</td> 1400 <td><a href="https://wg21.link/p0121r0">P0121R0</a></td> 1401 <td></td> 1402 <td class="na" align="center">Superseded by <a href="#p0734">P0734R0</a></td> 1403 </tr> 1404 <tr> 1405 <!-- track unimplemented Coroutines features: p0913r1 p0914r1 p1356r0 --> 1406 <td rowspan="2">[TS] Coroutines</td> 1407 <td rowspan="2"><a href="https://isocpp.org/files/papers/N4663.pdf">N4663</a></td> 1408 <td><tt>-fcoroutines-ts<br>-stdlib=libc++</tt></td> 1409 <td class="full" align="center">Clang 5</td> 1410 </tr> 1411 <tr> 1412 <td><tt>-std=c++20<br>-stdlib=libc++</tt></td> 1413 <td class="na" align="center">Superseded by <a href="#p0912">P0912R5</a></td> 1414 </tr> 1415 <tr> 1416 <td>[TS] Library Fundamentals, Version 1 (invocation type traits)</td> 1417 <td><a href="https://wg21.link/n4480">N4480</a></td> 1418 <td>N/A</td> 1419 <td class="none" align="center">No</td> 1420 </tr> 1421 <tr> 1422 <td>[TS] Library Fundamentals, Version 2 (<tt>source_location</tt>)</td> 1423 <td><a href="https://wg21.link/n4617">N4617</a></td> 1424 <td>N/A</td> 1425 <td class="full" align="center">Clang 9 (<a href="docs/LanguageExtensions.html#source-location-builtins">documentation</a>)</td> 1426 </tr> 1427 <tr> 1428 <td>[TS] Modules</td> 1429 <td><a href="https://wg21.link/n4720">N4720</a></td> 1430 <td><tt>-fmodules-ts</tt></td> 1431 <td class="na" align="center">Superseded by <a href="#p1103">P1103R3</a></td> 1432 </tr> 1433 <tr> 1434 <td>[DRAFT TS] Reflection</td> 1435 <td><a href="https://wg21.link/n4818">N4818</a></td> 1436 <td></td> 1437 <td class="none" align="center">No</td> 1438 </tr> 1439 <tr> 1440 <td>[TS] Transactional Memory</td> 1441 <td><a href="https://wg21.link/n4514">N4514</a></td> 1442 <td></td> 1443 <td class="none" align="center">No</td> 1444 </tr> 1445</table> 1446</details> 1447 1448</div> 1449</body> 1450</html> 1451