4 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5 <title>Clang - 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 .svn { background-color: #FFFF99 }
12 .full { background-color: #CCFF99 }
13 .na { background-color: #DDDDDD }
14 :target { background-color: #FFFFBB; outline: #DDDD55 solid thin; }
15 th { background-color: #FFDDAA }
16 td { vertical-align: middle }
17 tt { white-space: nowrap }
22 <!--#include virtual="menu.html.incl"-->
26 <!--*************************************************************************-->
27 <h1>C++ Support in Clang</h1>
28 <!--*************************************************************************-->
29 <p>Last updated: $Date: 2018-07-27 06:41:37 +0200 (Fri, 27 Jul 2018) $</p>
31 <p>Clang fully implements all published ISO C++ standards (<a
32 href="#cxx98">C++98 / C++03</a>, <a
33 href="#cxx11">C++11</a>, and <a
34 href="#cxx14">C++14</a>), and most of the upcoming <a
35 href="#cxx17">C++17</a> standard.
37 <p>The Clang community is continually striving to improve C++ standards
38 compliance between releases by submitting and tracking <a
39 href="cxx_dr_status.html">C++ Defect Reports</a> and implementing resolutions
40 as they become available.</p>
42 <p>Experimental work is also under way to implement <a href="#ts">C++ Technical
43 Specifications</a> that will help drive the future of the C++ programming
46 <p>The <a href="http://llvm.org/bugs/">LLVM bug tracker</a> contains Clang
47 C++ components that track known bugs with Clang's language conformance in
48 each language mode.</p>
50 <h2 id="cxx98">C++98 implementation status</h2>
52 <p>Clang implements all of the ISO C++ 1998 standard
53 (including the defects addressed in the ISO C++ 2003 standard)
54 except for <tt>export</tt> (which was removed in C++11).
56 <h2 id="cxx11">C++11 implementation status</h2>
58 <p>Clang 3.3 and later implement all of the <a
59 href="http://www.iso.org/standard/50372.html">ISO
60 C++ 2011 standard</a>.
62 <p>By default, Clang builds C++ code according to the C++98 standard, with many
63 C++11 features accepted as extensions. You can use Clang in C++11 mode with the
64 <code>-std=c++11</code> option. Clang's C++11 mode can be used
65 with <a href="http://libcxx.llvm.org/">libc++</a> or with gcc's libstdc++.
68 <summary>List of features and minimum Clang version with support</summary>
70 <table width="689" border="1" cellspacing="0">
72 <th>Language Feature</th>
73 <th>C++11 Proposal</th>
74 <th>Available in Clang?</th>
77 <td>Rvalue references</td>
78 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">N2118</a></td>
79 <td class="full" align="center">Clang 2.9</td>
82 <td> Rvalue references for <code>*this</code></td>
83 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm">N2439</a></td>
84 <td class="full" align="center">Clang 2.9</td>
87 <td>Initialization of class objects by rvalues</td>
88 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html">N1610</a></td>
89 <td class="full" align="center">Clang 2.9</td>
92 <td>Non-static data member initializers</td>
93 <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm">N2756</a></td>
94 <td class="full" align="center">Clang 3.0</td>
97 <td>Variadic templates</td>
98 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf">N2242</a></td>
99 <td class="full" align="center">Clang 2.9</td>
102 <td> Extending variadic template template parameters</td>
103 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">N2555</a></td>
104 <td class="full" align="center">Clang 2.9</td>
107 <td>Initializer lists</td>
108 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm">N2672</a></td>
109 <td class="full" align="center">Clang 3.1</td>
112 <td>Static assertions</td>
113 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html">N1720</a></td>
114 <td class="full" align="center">Clang 2.9</td>
117 <td><code>auto</code>-typed variables</td>
118 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf">N1984</a></td>
119 <td class="full" align="center">Clang 2.9</td>
122 <td> Multi-declarator <code>auto</code></td>
123 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf">N1737</a></td>
124 <td class="full" align="center">Clang 2.9</td>
127 <td> Removal of auto as a storage-class specifier</td>
128 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm">N2546</a></td>
129 <td class="full" align="center">Clang 2.9</td>
132 <td> New function declarator syntax</td>
133 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm">N2541</a></td>
134 <td class="full" align="center">Clang 2.9</td>
137 <td rowspan="2">Lambda expressions</td>
138 <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf">N2927</a></td>
139 <td class="full" align="center">Clang 3.1</td>
142 <!-- from Albuquerque 2017 -->
143 <td><a href="http://wg21.link/p0588r1">P0588R1</a> (<a href="#dr">DR</a>)</td>
144 <td class="none" align="center">No</td>
147 <td>Declared type of an expression</td>
148 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a></td>
149 <td class="full" align="center">Clang 2.9</td>
152 <td> Incomplete return types</td>
153 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf">N3276</a></td>
154 <td class="full" align="center">Clang 3.1</td>
157 <td>Right angle brackets</td>
158 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a></td>
159 <td class="full" align="center">Clang 2.9</td>
162 <td>Default template arguments for function templates</td>
163 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226">DR226</a></td>
164 <td class="full" align="center">Clang 2.9</td>
167 <td>Solving the SFINAE problem for expressions</td>
168 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html">DR339</a></td>
169 <td class="full" align="center">Clang 2.9</td>
172 <td>Alias templates</td>
173 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf">N2258</a></td>
174 <td class="full" align="center">Clang 3.0</td>
177 <td>Extern templates</td>
178 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm">N1987</a></td>
179 <td class="full" align="center">Clang 2.9</td>
182 <td>Null pointer constant</td>
183 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">N2431</a></td>
184 <td class="full" align="center">Clang 3.0</td>
187 <td>Strongly-typed enums</td>
188 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf">N2347</a></td>
189 <td class="full" align="center">Clang 2.9</td>
192 <td>Forward declarations for enums</td>
193 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf">N2764</a>
194 <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1206">DR1206</a></td>
195 <td class="full" align="center">Clang 3.1</td>
198 <td>Standardized attribute syntax</td>
199 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf">N2761</a></td>
200 <td class="full" align="center">Clang 3.3 <a href="#n2761">(1)</a></td>
203 <td rowspan="2">Generalized constant expressions</td>
204 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">N2235</a></td>
205 <td class="full" align="center">Clang 3.1</td>
208 <!-- from Albuquerque 2017 -->
209 <td><a href="http://wg21.link/p0859r0">P0859R0</a> (<a href="#dr">DR</a>)</td>
210 <td class="none" align="center">No</td>
213 <td>Alignment support</td>
214 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf">N2341</a></td>
215 <td class="full" align="center">Clang 3.3</td>
218 <td>Conditionally-support behavior</td>
219 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1627.pdf">N1627</a></td>
220 <td class="full" align="center">Clang 2.9</td>
223 <td>Changing undefined behavior into diagnosable errors</td>
224 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1727.pdf">N1727</a></td>
225 <td class="full" align="center">Clang 2.9</td>
228 <td>Delegating constructors</td>
229 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf">N1986</a></td>
230 <td class="full" align="center">Clang 3.0</td>
233 <td rowspan="2">Inheriting constructors</td>
234 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm">N2540</a></td>
235 <td class="full" align="center">Clang 3.3</td>
238 <!-- from Kona 2015 -->
239 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0136r1.html">P0136R1</a> (<a href="#dr">DR</a>)</td>
240 <td class="full" align="center">Clang 3.9</td>
243 <td>Explicit conversion operators</td>
244 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437</a></td>
245 <td class="full" align="center">Clang 3.0</td>
248 <td>New character types</td>
249 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html">N2249</a></td>
250 <td class="full" align="center">Clang 2.9</td>
253 <td>Unicode string literals</td>
254 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">N2442</a></td>
255 <td class="full" align="center">Clang 3.0</td>
258 <td>Raw string literals</td>
259 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">N2442</a></td>
260 <td class="full" align="center">Clang 3.0</td>
263 <td>Universal character names in literals</td>
264 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html">N2170</a></td>
265 <td class="full" align="center">Clang 3.1</td>
268 <td>User-defined literals</td>
269 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf">N2765</a></td>
270 <td class="full" align="center">Clang 3.1</td>
273 <td>Standard Layout Types</td>
274 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm">N2342</a></td>
275 <td class="full" align="center">Clang 3.0</td>
278 <td>Defaulted functions</td>
279 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a></td>
280 <td class="full" align="center">Clang 3.0</td>
283 <td>Deleted functions</td>
284 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a></td>
285 <td class="full" align="center">Clang 2.9</td>
288 <td>Extended friend declarations</td>
289 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf">N1791</a></td>
290 <td class="full" align="center">Clang 2.9</td>
293 <td>Extending <code>sizeof</code></td>
294 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html">N2253</a>
295 <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#850">DR850</a></td>
296 <td class="full" align="center">Clang 3.1</td>
299 <td>Inline namespaces</td>
300 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">N2535</a></td>
301 <td class="full" align="center">Clang 2.9</td>
304 <td>Unrestricted unions</td>
305 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf">N2544</a></td>
306 <td class="full" align="center">Clang 3.1</td>
309 <td>Local and unnamed types as template arguments</td>
310 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm">N2657</a></td>
311 <td class="full" align="center">Clang 2.9</td>
314 <td rowspan="2">Range-based for</td>
315 <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html">N2930</a></td>
316 <td class="full" align="center">Clang 3.0</td>
319 <!-- from Jacksonville 2018 -->
320 <td><a href="http://wg21.link/p0962r1">P0962R1</a> (<a href="#dr">DR</a>)</td>
321 <td class="none" align="center">No</td>
324 <td>Explicit virtual overrides</td>
325 <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm">N2928</a>
326 <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm">N3206</a>
327 <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">N3272</a></td>
328 <td class="full" align="center">Clang 3.0</td>
331 <td>Minimal support for garbage collection and reachability-based leak detection</td>
332 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm">N2670</a></td>
333 <td class="na" align="center">N/A <a href="#n2670">(2)</a></td>
336 <td>Allowing move constructors to throw [noexcept]</td>
337 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html">N3050</a></td>
338 <td class="full" align="center">Clang 3.0</td>
341 <td>Defining move special member functions</td>
342 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html">N3053</a></td>
343 <td class="full" align="center">Clang 3.0</td>
346 <tr class="separator">
347 <th align="center" colspan="3">Concurrency</th>
350 <td>Sequence points</td>
351 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html">N2239</a></td>
352 <td class="full" align="center">Clang 3.3</td>
355 <td>Atomic operations</td>
356 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html">N2427</a></td>
357 <td class="full" align="center">Clang 3.1</td>
360 <td>Strong Compare and Exchange</td>
361 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2748.html">N2748</a></td>
362 <td class="full" align="center">Clang 3.1 <a href="#n2748">(3)</a></td>
365 <td>Bidirectional Fences</td>
366 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm">N2752</a></td>
367 <td class="full" align="center">Clang 3.1</td>
371 <td>Memory model</td>
372 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm">N2429</a></td>
373 <td class="full" align="center">Clang 3.2</td>
376 <td>Data-dependency ordering: atomics and memory model</td>
377 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm">N2664</a></td>
378 <td class="full" align="center">Clang 3.2 <a href="#n2664">(4)</a></td>
381 <td>Propagating exceptions</td>
382 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">N2179</a></td>
383 <td class="full" align="center">Clang 2.9</td>
386 <td>Allow atomics use in signal handlers</td>
387 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm">N2547</a></td>
388 <td class="full" align="center">Clang 3.1</td>
391 <td>Thread-local storage</td>
392 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm">N2659</a></td>
393 <td class="full" align="center">Clang 3.3 <a href="#n2659">(5)</a></td>
396 <td>Dynamic initialization and destruction with concurrency</td>
397 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm">N2660</a></td>
398 <td class="full" align="center">Clang 2.9</td>
401 <tr class="separator">
402 <th align="center" colspan="3">C99 Features in C++11</th>
405 <td><code>__func__</code> predefined identifier</td>
406 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm">N2340</a></td>
407 <td class="full" align="center">Clang 2.9</td>
410 <td>C99 preprocessor</td>
411 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm">N1653</a></td>
412 <td class="full" align="center">Clang 2.9</td>
415 <td><code>long long</code></td>
416 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf">N1811</a></td>
417 <td class="full" align="center">Clang 2.9</td>
420 <td>Extended integral types</td>
421 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf">N1988</a></td>
422 <td class="na" align="center">N/A <a href="#n1988">(6)</a></td>
427 <span id="n2761">(1): The <code>[[carries_dependency]]</code> attribute
428 has no effect.</span><br>
429 <span id="n2670">(2): No compiler changes are required for an implementation
430 such as Clang that does not provide garbage collection.</span><br>
431 <span id="n2748">(3): All compare-exchange operations are emitted as
432 strong compare-exchanges.</span><br>
433 <span id="n2664">(4): <code>memory_order_consume</code> is lowered to
434 <code>memory_order_acquire</code>.</span><br>
435 <span id="n2659">(5): <code>thread_local</code> support
436 requires a C++ runtime library providing <code>__cxa_thread_atexit</code>, such
437 as <a href="http://libcxxabi.llvm.org">libc++abi</a> 3.6 or later,
438 or libsupc++ 4.8 or later.</span><br>
439 <span id="n1988">(6): No compiler changes are required for an implementation
440 such as Clang that does not provide any extended integer types.
441 <code>__int128</code> is not treated as an extended integer type,
442 because changing <code>intmax_t</code> would be an ABI-incompatible
447 <h2 id="cxx14">C++14 implementation status</h2>
449 <p>Clang 3.4 and later implement all of the <a
450 href="http://www.iso.org/standard/64029.html">ISO
451 C++ 2014 standard</a>.
453 <p>You can use Clang in C++14 mode with the <code>-std=c++14</code> option
454 (use <code>-std=c++1y</code> in Clang 3.4 and earlier).</p>
457 <summary>List of features and minimum Clang version with support</summary>
459 <table width="689" border="1" cellspacing="0">
461 <th>Language Feature</th>
462 <th>C++14 Proposal</th>
463 <th>Available in Clang?</th>
466 <td>Tweak to certain C++ contextual conversions</td>
467 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3323.pdf">N3323</a></td>
468 <td class="full" align="center">Clang 3.4</td>
471 <td>Binary literals</td>
472 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3472.pdf">N3472</a></td>
473 <td class="full" align="center">Clang 2.9</td>
476 <td>decltype(auto)</td>
477 <td rowspan=2 style="vertical-align:middle"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3638.html">N3638</a></td>
478 <td class="full" align="center">Clang 3.3</td>
481 <td>Return type deduction for normal functions</td>
482 <td class="full" align="center">Clang 3.4</td>
485 <td>Initialized lambda captures</td>
486 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3648.html">N3648</a></td>
487 <td class="full" align="center">Clang 3.4</td>
490 <td>Generic lambdas</td>
491 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3649.html">N3649</a></td>
492 <td class="full" align="center">Clang 3.4</td>
495 <td>Variable templates</td>
496 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3651.pdf">N3651</a></td>
497 <td class="full" align="center">Clang 3.4</td>
500 <td>Relaxing requirements on constexpr functions</td>
501 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html">N3652</a></td>
502 <td class="full" align="center">Clang 3.4</td>
505 <td>Member initializers and aggregates</td>
506 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3653.html">N3653</a></td>
507 <td class="full" align="center">Clang 3.3</td>
510 <td>Clarifying memory allocation</td>
511 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3664.html">N3664</a></td>
512 <td class="full" align="center">Clang 3.4</td>
515 <td><tt>[[deprecated]]</tt> attribute</td>
516 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3760.html">N3760</a></td>
517 <td class="full" align="center">Clang 3.4</td>
520 <td>Single quotation mark as digit separator</td>
521 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf">N3781</a></td>
522 <td class="full" align="center">Clang 3.4</td>
525 <td>C++ Sized Deallocation</td>
526 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3778.html">N3778</a></td>
527 <td class="full" align="center">Clang 3.4 <a href="#n3778">(7)</a></td>
532 <span id="n3778">(7): In Clang 3.7 and later, sized deallocation is only enabled
533 if the user passes the <code>-fsized-deallocation</code> flag. The user must
534 supply definitions of the sized deallocation functions, either by providing them
535 explicitly or by using a C++ standard library that does. <code>libstdc++</code>
536 added these functions in version 5.0, and <code>libc++</code> added them in
542 <h2 id="cxx17">C++17 implementation status</h2>
544 <p>Clang 5 and later implement all the features of the
545 <a href="https://www.iso.org/standard/68564.html">ISO C++ 2017 standard</a>.
547 <p>You can use Clang in C++17 mode with the <code>-std=c++17</code> option
548 (use <code>-std=c++1z</code> in Clang 4 and earlier).</p>
551 <summary>List of features and minimum Clang version with support</summary>
553 <table width="689" border="1" cellspacing="0">
555 <th>Language Feature</th>
556 <th>C++17 Proposal</th>
557 <th>Available in Clang?</th>
559 <!-- Issaquah 2014 papers -->
561 <td><tt>static_assert</tt> with no message</td>
562 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3928.pdf">N3928</a></td>
563 <td class="full" align="center">Clang 3.5</td>
565 <!-- Rapperswil papers -->
567 <td>Disabling trigraph expansion by default</td>
568 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4086.html">N4086</a></td>
569 <td class="full" align="center">Clang 3.5</td>
573 <td rowspan="2">Terse range-based for loops (removed from C++17)</td>
574 <td rowspan="2"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3994.htm">N3994</a></td>
575 <td class="none" align="center">Clang 3.5: Yes</td>
578 <td class="svn" align="center">SVN: No</td>
582 <td><tt>typename</tt> in a template template parameter</td>
583 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4051.html">N4051</a></td>
584 <td class="full" align="center">Clang 3.5</td>
587 <td>New <tt>auto</tt> rules for direct-list-initialization
588 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html">N3922</a></td>
589 <td class="full" align="center">Clang 3.8 <a href="#n3922">(8)</a></td>
591 <!-- Urbana papers -->
593 <td rowspan="2">Fold expressions</td>
594 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4295.html">N4295</a></td>
595 <td class="full" align="center">Clang 3.6</td>
597 <tr> <!-- from Jacksonville -->
598 <td><a href="http://wg21.link/p0036r0">P0036R0</a></td>
599 <td class="full" align="center">Clang 3.9</td>
602 <td><tt>u8</tt> character literals</td>
603 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4267.html">N4267</a></td>
604 <td class="full" align="center">Clang 3.6</td>
607 <td>Nested namespace definition</td>
608 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4230.html">N4230</a></td>
609 <td class="full" align="center">Clang 3.6</td>
612 <td>Attributes for namespaces and enumerators</td>
613 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4266.html">N4266</a></td>
614 <td class="full" align="center">Clang 3.6</td>
617 <td>Allow constant evaluation for all non-type template arguments</td>
618 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4268.html">N4268</a></td>
619 <td class="full" align="center">Clang 3.6</td>
623 <td>Remove deprecated <tt>register</tt> storage class</td>
624 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0001r1.html">P0001R1</a></td>
625 <td class="full" align="center">Clang 3.8</td>
628 <td>Remove deprecated <tt>bool</tt> increment</td>
629 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0002r1.html">P0002R1</a></td>
630 <td class="full" align="center">Clang 3.8</td>
633 <td>Make exception specifications part of the type system</td>
634 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html">P0012R1</a></td>
635 <td class="full" align="center">Clang 4</td>
638 <td><tt>__has_include</tt> in preprocessor conditionals</td>
639 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0061.html">P0061R1</a></td>
640 <td class="full" align="center">Yes</td>
642 <!-- Jacksonville papers -->
644 <td><tt>[[fallthrough]]</tt> attribute</td>
645 <td><a href="http://wg21.link/p0188r1">P0188R1</a></td>
646 <td class="full" align="center">Clang 3.9</td>
649 <td><tt>[[nodiscard]]</tt> attribute</td>
650 <td><a href="http://wg21.link/p0189r1">P0189R1</a></td>
651 <td class="full" align="center">Clang 3.9</td>
654 <td><tt>[[maybe_unused]]</tt> attribute</td>
655 <td><a href="http://wg21.link/p0212r1">P0212R1</a></td>
656 <td class="full" align="center">Clang 3.9</td>
659 <td>Aggregate initialization of classes with base classes</td>
660 <td><a href="http://wg21.link/p0017r1">P0017R1</a></td>
661 <td class="full" align="center">Clang 3.9</td>
664 <td><tt>constexpr</tt> lambda expressions</td>
665 <td><a href="http://wg21.link/p0170r1">P0170R1</a></td>
666 <td class="full" align="center">Clang 5</td>
669 <td>Differing <tt>begin</tt> and <tt>end</tt> types in range-based <tt>for</tt></td>
670 <td><a href="http://wg21.link/p0184r0">P0184R0</a></td>
671 <td class="full" align="center">Clang 3.9</td>
674 <td>Lambda capture of <tt>*this</tt></td>
675 <td><a href="http://wg21.link/p0018r3">P0018R3</a></td>
676 <td class="full" align="center">Clang 3.9</td>
679 <td>Direct-list-initialization of <tt>enum</tt>s</td>
680 <td><a href="http://wg21.link/p0138r2">P0138R2</a></td>
681 <td class="full" align="center">Clang 3.9</td>
684 <td>Hexadecimal floating-point literals</td>
685 <td><a href="http://wg21.link/p0245r1">P0245R1</a></td>
686 <td class="full" align="center">Yes</td>
690 <td>Using attribute namespaces without repetition</td>
691 <td><a href="http://wg21.link/p0028r4">P0028R4</a></td>
692 <td class="full" align="center">Clang 3.9</td>
695 <td>Dynamic memory allocation for over-aligned data</td>
696 <td><a href="http://wg21.link/p0035r4">P0035R4</a></td>
697 <td class="full" align="center">Clang 4</td>
700 <td rowspan="4">Template argument deduction for class templates</td>
701 <td><a href="http://wg21.link/p0091r3">P0091R3</a></td>
702 <td rowspan="2" class="full" align="center">Clang 5</td>
704 <tr> <!-- from Issaquah -->
705 <td><a href="http://wg21.link/p0512r0">P0512R0</a></td>
708 <!-- from Kona 2017 -->
709 <td><a href="http://wg21.link/p0620r1">P0620R0</a> (<a href="#dr">DR</a>)</td>
710 <td class="svn" align="center">SVN</td>
713 <!-- from Toronto 2017 -->
714 <td><a href="http://wg21.link/p0702r1">P0702R1</a> (<a href="#dr">DR</a>)</td>
715 <td class="full" align="center">Clang 6</td>
718 <td>Non-type template parameters with <tt>auto</tt> type</td>
719 <td><a href="http://wg21.link/p0127r2">P0127R2</a></td>
720 <td class="full" align="center">Clang 4</td>
723 <td>Guaranteed copy elision</td>
724 <td><a href="http://wg21.link/p0135r1">P0135R1</a></td>
725 <td class="full" align="center">Clang 4</td>
728 <td rowspan=2>Stricter expression evaluation order</td>
729 <td><a href="http://wg21.link/p0145r3">P0145R3</a></td>
730 <td class="full" align="center" rowspan=2>Clang 4 <a href="#p0145">(9)</a></td>
733 <td><a href="http://wg21.link/p0400r0">P0400R0</a></td>
736 <td>Requirement to ignore unknown attributes</td>
737 <td><a href="http://wg21.link/p0283r2">P0283R2</a></td>
738 <td class="full" align="center">Yes</td>
741 <td><tt>constexpr</tt> <em>if-statement</em>s</td>
742 <td><a href="http://wg21.link/p0292r2">P0292R2</a></td>
743 <td class="full" align="center">Clang 3.9</td>
746 <td>Inline variables</td>
747 <td><a href="http://wg21.link/p0386r2">P0386R2</a></td>
748 <td class="full" align="center">Clang 3.9</td>
751 <td rowspan="3">Structured bindings</td>
752 <td><a href="http://wg21.link/p0217r3">P0217R3</a></td>
753 <td class="full" align="center">Clang 4</td>
756 <!-- from Jacksonville 2018 -->
757 <td><a href="http://wg21.link/p0961r1">P0961R1</a> (<a href="#dr">DR</a>)</td>
758 <td class="none" align="center">No</td>
761 <!-- from Jacksonville 2018 -->
762 <td><a href="http://wg21.link/p0969r0">P0969R0</a> (<a href="#dr">DR</a>)</td>
763 <td class="none" align="center">No</td>
766 <td>Separate variable and condition for <tt>if</tt> and <tt>switch</tt></td>
767 <td><a href="http://wg21.link/p0305r1">P0305R1</a></td>
768 <td class="full" align="center">Clang 3.9</td>
770 <!-- Issaquah 2016 papers -->
772 <td>Matching template template parameters to compatible arguments</td>
773 <td><a href="http://wg21.link/p0522r0">P0522R0</a></td>
774 <td class="partial" align="center">Partial <a href="#p0522">(10)</a></td>
777 <td>Removing deprecated dynamic exception specifications</td>
778 <td><a href="http://wg21.link/p0003r5">P0003R5</a></td>
779 <td class="full" align="center">Clang 4</td>
782 <td>Pack expansions in <em>using-declarations</em></td>
783 <td><a href="http://wg21.link/p0195r2">P0195R2</a></td>
784 <td class="full" align="center">Clang 4</td>
789 <span id="n3922">(8): This is a backwards-incompatible change that is applied to
790 all language versions that allow type deduction from <tt>auto</tt>
791 (per the request of the C++ committee).
792 In Clang 3.7, a warning is emitted for all cases that would change meaning.
794 <span id="p0145">(9): Under the MS ABI, function parameters are destroyed from
795 left to right in the callee. As a result, function parameters in calls to
796 <tt>operator<<</tt>, <tt>operator>></tt>, <tt>operator->*</tt>,
797 <tt>operator&&</tt>, <tt>operator||</tt>, and <tt>operator,</tt>
798 functions using expression syntax are no longer guaranteed to be destroyed in
799 reverse construction order in that ABI.
801 <span id="p0522">(10): Despite being the resolution to a Defect Report, this
802 feature is disabled by default in all language versions, and can be enabled
803 explicitly with the flag <tt>-frelaxed-template-template-args</tt> in Clang 4
805 The change to the standard lacks a corresponding change for template partial
806 ordering, resulting in ambiguity errors for reasonable and previously-valid
807 code. This issue is expected to be rectified soon.
812 <h2 id="cxx20">C++2a implementation status</h2>
814 <p>Clang has <b>experimental</b> support for some proposed features of
815 the C++ standard following C++17, provisionally named C++2a.
816 Note that support for these features may change or be removed without notice,
817 as the draft C++2a standard evolves.
819 <p>You can use Clang in C++2a mode with the <code>-std=c++2a</code> option.</p>
822 <summary>List of features and minimum Clang version with support</summary>
824 <table width="689" border="1" cellspacing="0">
826 <th>Language Feature</th>
827 <th>C++2a Proposal</th>
828 <th>Available in Clang?</th>
830 <!-- Toronto 2017 papers -->
832 <td>Default member initializers for bit-fields</td>
833 <td><a href="http://wg21.link/p0683r1">P0683R1</a></td>
834 <td class="full" align="center">Clang 6</td>
837 <td><tt>const&</tt>-qualified pointers to members</td>
838 <td><a href="http://wg21.link/p0704r1">P0704R1</a></td>
839 <td class="full" align="center">Clang 6</td>
842 <td>Allow <i>lambda-capture</i> <tt>[=, this]</tt></td>
843 <td><a href="http://wg21.link/p0409r2">P0409R2</a></td>
844 <td class="full" align="center">Clang 6</td>
847 <td rowspan="2"><tt>__VA_OPT__</tt> for preprocessor comma elision</td>
848 <td><a href="http://wg21.link/p0306r4">P0306R4</a></td>
849 <td class="full" align="center">Clang 6</td>
851 <tr> <!-- from Rapperswil -->
852 <td><a href="http://wg21.link/p1042r1">P1042R1</a></td>
853 <td class="partial" align="center">Partial</td>
856 <td>Designated initializers</td>
857 <td><a href="http://wg21.link/p0329r4">P0329R4</a></td>
858 <td class="partial" align="center">Partial (extension)</td>
861 <td><i>template-parameter-list</i> for generic lambdas</td>
862 <td><a href="http://wg21.link/p0428r2">P0428R2</a></td>
863 <td class="none" align="center">No</td>
866 <td rowspan="2">Concepts</td>
867 <td><a href="http://wg21.link/p0734r0">P0734R0</a></td>
868 <td rowspan="2" class="none" align="center">No</td>
870 <tr> <!-- from Albuquerque -->
871 <td><a href="http://wg21.link/p0857r0">P0857R0</a></td>
873 <!-- Albuquerque papers -->
875 <td>Range-based for statements with initializer</td>
876 <td><a href="http://wg21.link/p0614r1">P0614R1</a></td>
877 <td class="none" align="center">No</td>
880 <td>ADL and function templates that are not visible</td>
881 <td><a href="http://wg21.link/p0846r0">P0846R0</a></td>
882 <td class="none" align="center">No</td>
885 <td><tt>const</tt> mismatch with defaulted copy constructor</td>
886 <td><a href="http://wg21.link/p0641r2">P0641R2</a></td>
887 <td class="none" align="center">No</td>
890 <td rowspan="3">Consistent comparison (<tt>operator<=></tt>)</td>
891 <td><a href="http://wg21.link/p0515r3">P0515R3</a></td>
892 <td rowspan="3" class="partial" align="center">Partial</td>
894 <tr> <!-- from Jacksonville -->
895 <td><a href="http://wg21.link/p0905r1">P0905R1</a></td>
897 <tr> <!-- from Rapperswil -->
898 <td><a href="http://wg21.link/p1120r0">P1120R0</a></td>
901 <td>Access checking on specializations</td>
902 <td><a href="http://wg21.link/p0692r1">P0692R1</a></td>
903 <td class="partial" align="center">Partial</td>
906 <td>Default constructible and assignable stateless lambdas</td>
907 <td><a href="http://wg21.link/p0624r2">P0624R2</a></td>
908 <td class="none" align="center">No</td>
911 <td>Lambdas in unevaluated contexts</td>
912 <td><a href="http://wg21.link/p0315r4">P0315R4</a></td>
913 <td class="none" align="center">No</td>
915 <!-- Jacksonville papers -->
917 <td><tt>[[no_unique_address]]</tt> attribute</td>
918 <td><a href="http://wg21.link/p0840r2">P0840R2</a></td>
919 <td class="none" align="center">No</td>
922 <td><tt>[[likely]]</tt> and <tt>[[unlikely]]</tt> attributes</td>
923 <td><a href="http://wg21.link/p0479r5">P0479R5</a></td>
924 <td class="none" align="center">No</td>
927 <td><tt>typename</tt> optional in more contexts</td>
928 <td><a href="http://wg21.link/p0634r3">P0634R3</a></td>
929 <td class="none" align="center">No</td>
932 <td>Pack expansion in lambda <i>init-capture</i></td>
933 <td><a href="http://wg21.link/p0780r2">P0780R2</a></td>
934 <td class="none" align="center">No</td>
936 <!-- Rapperswil papers -->
938 <td>Class types as non-type template parameters</td>
939 <td><a href="http://wg21.link/p0732r2">P0732R2</a></td>
940 <td class="none" align="center">No</td>
943 <td>Destroying operator delete</td>
944 <td><a href="http://wg21.link/p0722r3">P0722R3</a></td>
945 <td class="full" align="center">Clang 6</td>
948 <td>Virtual function calls in constant expressions</td>
949 <td><a href="http://wg21.link/p1064r0">P1064R0</a></td>
950 <td class="none" align="center">No</td>
953 <td>Prohibit aggregates with user-declared constructors</td>
954 <td><a href="http://wg21.link/p1008r1">P1008R1</a></td>
955 <td class="none" align="center">No</td>
959 <td><a href="http://wg21.link/p0542r5">P0542R5</a></td>
960 <td class="none" align="center">No</td>
963 <td>Feature test macros</td>
964 <td><a href="http://wg21.link/p0941r2">P0941R2</a></td>
965 <td class="full" align="center"><a href="#sd6">(see below)</a></td>
968 <td><tt>explicit(bool)</tt></td>
969 <td><a href="http://wg21.link/p0892r2">P0892R2</a></td>
970 <td class="none" align="center">No</td>
975 <h2 id="dr">Defect reports</h2>
977 <p>Clang generally aims to implement resolutions to Defect Reports (bug fixes
978 against prior standards) retroactively, in all prior standard versions where
979 the fix is meaningful. Significant Defect Report changes to language features
980 after the publication of the relevant standard are marked (DR) in the above
983 <p>Clang also has a test suite for conformance to resolutions for issues on the
984 <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_toc.html">C++ core issues list</a>,
985 most of which are considered Defect Reports.
986 <a href="cxx_dr_status.html">Implementation status for C++ core issues</a> based on
987 that test suite is tracked on a separate page.</p>
989 <h2 id="ts">Technical specifications and standing documents</h2>
991 <p>ISO C++ also publishes a number of documents describing additional language
992 and library features that are not part of standard C++.</p>
995 <summary>List of features and minimum Clang version with support</summary>
997 <table width="689" border="1" cellspacing="0">
1000 <th>Latest draft</th>
1001 <th>Compiler flag</th>
1002 <th>Available in Clang?</th>
1005 <td rowspan="5">SD-6: SG10 feature test recommendations</td>
1006 <td rowspan="5"><a href="http://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations">SD-6</a></td>
1007 <td rowspan="5">N/A</td>
1008 <td class="full" align="center">
1009 Clang 3.4 (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3745">N3745</a>)</br>
1013 <td class="full" align="center">
1014 Clang 3.6 (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4200">N4200</a>)</a>
1018 <td class="full" align="center">
1019 Clang 4 (<a href="http://wg21.link/p0096r3">P0096R3</a>)</a>
1023 <td class="full" align="center">
1024 Clang 5 (<a href="http://wg21.link/p0096r4">P0096R4</a>)</a>
1028 <td class="svn" align="center">
1029 SVN (<a href="http://wg21.link/p0096r5">P0096R5</a>)</a>
1032 <!-- FIXME: Implement latest recommendations.
1034 <td class="svn" align="center">
1035 SVN (<a href="http://wg21.link/p0096r3">P0096R3</a>)</a>
1039 <!-- No compiler support is known to be needed for:
1041 * Parallelism TS (v1, v2)
1047 <td>[TS] Concepts</td>
1048 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0121r0.pdf">P0121R0</a></td>
1050 <td class="na" align="center">Superseded by <a href="#p0734">P0734R0</a></td>
1053 <!-- track unimplemented Coroutines features: p0913r1 p0914r1 -->
1054 <td>[DRAFT TS] Coroutines</td>
1055 <td><a href="https://isocpp.org/files/papers/N4663.pdf">N4663</a></td>
1056 <td><tt>-fcoroutines-ts<br>-stdlib=libc++</tt></td>
1057 <td class="full" align="center">Clang 5</td>
1060 <td>[TS] Library Fundamentals, Version 1 (invocation type traits)</td>
1061 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html">N4480</a></td>
1063 <td class="none" align="center">No</td>
1066 <td>[TS] Library Fundamentals, Version 2 (<tt>source_location</tt>)</td>
1067 <td><a href="http://wg21.link/n4617">N4617</a></td>
1069 <td class="none" align="center">No</td>
1072 <td>[TS] Modules</td>
1073 <td><a href="http://wg21.link/n4720">N4720</a></td>
1074 <td><tt>-fmodules-ts</tt></td>
1075 <td class="none" align="center">WIP</td>
1078 <td>[DRAFT TS] Reflection</td>
1079 <td><a href="http://wg21.link/n4746">N4746</a></td>
1081 <td class="none" align="center">No</td>
1084 <td>[TS] Transactional Memory</td>
1085 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4514.pdf">N4514</a></td>
1087 <td class="none" align="center">No</td>