• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2          "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4<head>
5  <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6  <title>Clang - C++98 and C++11 Status</title>
7  <link type="text/css" rel="stylesheet" href="menu.css">
8  <link type="text/css" rel="stylesheet" href="content.css">
9  <style type="text/css">
10    .none { background-color: #FFCCCC }
11    .svn  { background-color: #FFFF99 }
12    .full { background-color: #CCFF99 }
13    .na { background-color: #DDDDDD }
14    th { background-color: #FFDDAA }
15  </style>
16</head>
17<body>
18
19<!--#include virtual="menu.html.incl"-->
20
21<div id="content">
22
23<!--*************************************************************************-->
24<h1>C++98 and C++11 Support in Clang</h1>
25<!--*************************************************************************-->
26<p>Last updated: $Date$</p>
27
28<h2 id="cxx98">C++98 implementation status</h2>
29
30<p>Clang currently implements all of the ISO C++ 1998 standard
31  (including the defects addressed in the ISO C++ 2003 standard)
32  except for 'export' (which has been removed in C++11)
33  and is considered a production-quality C++ compiler.  The <a
34   href="http://llvm.org/bugs/">LLVM bug tracker</a> contains a Clang
35  C++ component that tracks known Clang C++ bugs.</p>
36
37<h2 id="cxx11">C++11 implementation status</h2>
38
39  <p>Clang provides support for a number of features included in the new <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=50372">ISO C++ Standard, ISO/IEC 14882:2011</a>. The following table describes which C++11 features have been implemented in Clang and in which Clang versions they became available.</p>
40
41<p>You can use Clang in C++11 mode either
42with <a href="http://libcxx.llvm.org/">libc++</a> or with gcc's libstdc++.
43Patches are needed to make <a href="libstdc++4.4-clang0x.patch">libstdc++-4.4</a>
44and <a href="libstdc++4.7-clang11.patch">libstdc++-4.7</a> work with Clang in
45C++11 mode.</p>
46
47<table width="689" border="1" cellspacing="0">
48 <tr>
49    <th>Language Feature</th>
50    <th>C++11 Proposal</th>
51    <th>Available in Clang?</th>
52 </tr>
53     <tr>
54      <td>Rvalue references</td>
55      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">N2118</a></td>
56      <td class="full" align="center">Clang 2.9</td>
57    </tr>
58    <tr>
59      <td>&nbsp;&nbsp;&nbsp;&nbsp;Rvalue references for <code>*this</code></td>
60      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm">N2439</a></td>
61      <td class="full" align="center">Clang 2.9</td>
62    </tr>
63    <tr>
64      <td>Initialization of class objects by rvalues</td>
65      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html">N1610</a></td>
66      <td class="full" align="center">Clang 2.9</td>
67    </tr>
68    <tr>
69      <td>Non-static data member initializers</td>
70      <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm">N2756</a></td>
71      <td class="full" align="center">Clang 3.0</td>
72    </tr>
73    <tr>
74      <td>Variadic templates</td>
75      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf">N2242</a></td>
76      <td class="full" align="center">Clang 2.9</td>
77    </tr>
78    <tr>
79      <td>&nbsp;&nbsp;&nbsp;&nbsp;Extending variadic template template parameters</td>
80      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">N2555</a></td>
81      <td class="full" align="center">Clang 2.9</td>
82    </tr>
83    <tr>
84      <td>Initializer lists</td>
85      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm">N2672</a></td>
86      <td class="full" align="center">Clang 3.1</td>
87    </tr>
88    <tr>
89      <td>Static assertions</td>
90      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html">N1720</a></td>
91      <td class="full" align="center">Clang 2.9</td>
92    </tr>
93    <tr>
94      <td><code>auto</code>-typed variables</td>
95      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf">N1984</a></td>
96      <td class="full" align="center">Clang 2.9</td>
97    </tr>
98    <tr>
99      <td>&nbsp;&nbsp;&nbsp;&nbsp;Multi-declarator <code>auto</code></td>
100      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf">N1737</a></td>
101      <td class="full" align="center">Clang 2.9</td>
102    </tr>
103    <tr>
104      <td>&nbsp;&nbsp;&nbsp;&nbsp;Removal of auto as a storage-class specifier</td>
105      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm">N2546</a></td>
106      <td class="full" align="center">Clang 2.9</td>
107    </tr>
108    <tr>
109      <td>&nbsp;&nbsp;&nbsp;&nbsp;New function declarator syntax</td>
110      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm">N2541</a></td>
111      <td class="full" align="center">Clang 2.9</td>
112    </tr>
113    <tr>
114      <td>Lambda expressions</td>
115      <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf">N2927</a></td>
116      <td class="full" align="center">Clang 3.1</td>
117    </tr>
118    <tr>
119      <td>Declared type of an expression</td>
120      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a></td>
121      <td class="full" align="center">Clang 2.9</td>
122    </tr>
123    <tr>
124      <td>&nbsp;&nbsp;&nbsp;&nbsp;Incomplete return types</td>
125      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf">N3276</a></td>
126      <td class="full" align="center">Clang 3.1</td>
127    </tr>
128    <tr>
129      <td>Right angle brackets</td>
130      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a></td>
131      <td class="full" align="center">Clang 2.9</td>
132    </tr>
133    <tr>
134      <td>Default template arguments for function templates</td>
135      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226">DR226</a></td>
136      <td class="full" align="center">Clang 2.9</td>
137    </tr>
138    <tr>
139      <td>Solving the SFINAE problem for expressions</td>
140      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html">DR339</a></td>
141      <td class="full" align="center">Clang 2.9</td>
142    </tr>
143    <tr>
144      <td>Alias templates</td>
145      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf">N2258</a></td>
146      <td class="full" align="center">Clang 3.0</td>
147    </tr>
148    <tr>
149      <td>Extern templates</td>
150      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm">N1987</a></td>
151      <td class="full" align="center">Clang 2.9</td>
152    </tr>
153    <tr>
154      <td>Null pointer constant</td>
155      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">N2431</a></td>
156      <td class="full" align="center">Clang 3.0</td>
157    </tr>
158    <tr>
159      <td>Strongly-typed enums</td>
160      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf">N2347</a></td>
161      <td class="full" align="center">Clang 2.9</td>
162    </tr>
163    <tr>
164      <td>Forward declarations for enums</td>
165      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf">N2764</a>
166      <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1206">DR1206</a></td>
167      <td class="full" align="center">Clang 3.1</td>
168    </tr>
169    <tr>
170      <td>Generalized attributes</td>
171      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf">N2761</a></td>
172      <td class="none" align="center">No</td>
173    </tr>
174    <tr>
175      <td>Generalized constant expressions</td>
176      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">N2235</a></td>
177      <td class="full" align="center">Clang 3.1</td>
178    </tr>
179    <tr>
180      <td>Alignment support</td>
181      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf">N2341</a></td>
182      <td class="full" align="center">Clang 3.0</td>
183    </tr>
184    <!-- Skipped N1627: Conditionally-support behavior -->
185    <!-- Skipped N1727: Changing Undefined Behavior into Diagnosable Errors -->
186    <tr>
187      <td>Delegating constructors</td>
188      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf">N1986</a></td>
189      <td class="full" align="center">Clang 3.0</td>
190    </tr>
191    <tr>
192      <td>Inheriting constructors</td>
193      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm">N2540</a></td>
194      <td class="none" align="center">No</td>
195    </tr>
196    <tr>
197      <td>Explicit conversion operators</td>
198      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437</a></td>
199      <td class="full" align="center">Clang 3.0</td>
200    </tr>
201    <tr>
202      <td>New character types</td>
203      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html">N2249</a></td>
204      <td class="full" align="center">Clang 2.9</td>
205    </tr>
206    <tr>
207      <td>Unicode string literals</td>
208      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">N2442</a></td>
209      <td class="full" align="center">Clang 3.0</td>
210    </tr>
211    <tr>
212      <td>Raw string literals</td>
213      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm">N2442</a></td>
214      <td class="full" align="center">Clang 3.0</td>
215    </tr>
216    <tr>
217      <td>Universal character names in literals</td>
218      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html">N2170</a></td>
219      <td class="full" align="center">Clang 3.1</td>
220    </tr>
221    <tr>
222      <td>User-defined literals</td>
223      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf">N2765</a></td>
224      <td class="full" align="center">Clang 3.1</td>
225    </tr>
226    <tr>
227      <td>Standard Layout Types</td>
228      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm">N2342</a></td>
229      <td class="full" align="center">Clang 3.0</td>
230    </tr>
231    <tr>
232      <td>Defaulted functions</td>
233      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a></td>
234      <td class="full" align="center">Clang 3.0</td>
235    </tr>
236    <tr>
237      <td>Deleted functions</td>
238      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a></td>
239      <td class="full" align="center">Clang 2.9</td>
240    </tr>
241    <tr>
242      <td>Extended friend declarations</td>
243      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf">N1791</a></td>
244      <td class="full" align="center">Clang 2.9</td>
245    </tr>
246    <tr>
247      <td>Extending <code>sizeof</code></td>
248      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html">N2253</a>
249      <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#850">DR850</a></td>
250      <td class="full" align="center">Clang 3.1</td>
251    </tr>
252    <tr>
253      <td>Inline namespaces</td>
254      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">N2535</a></td>
255      <td class="full" align="center">Clang 2.9</td>
256    </tr>
257    <tr>
258      <td>Unrestricted unions</td>
259      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf">N2544</a></td>
260      <td class="full" align="center">Clang 3.1</td>
261    </tr>
262    <tr>
263      <td>Local and unnamed types as template arguments</td>
264      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm">N2657</a></td>
265      <td class="full" align="center">Clang 2.9</td>
266    </tr>
267    <tr>
268      <td>Range-based for</td>
269      <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html">N2930</a></td>
270      <td class="full" align="center">Clang 3.0</td>
271    </tr>
272    <tr>
273      <td>Explicit virtual overrides</td>
274      <td><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm">N2928</a>
275      <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm">N3206</a>
276      <br><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm">N3272</a></td>
277      <td class="full" align="center">Clang 3.0</td>
278    </tr>
279    <tr>
280      <td>Minimal support for garbage collection and reachability-based leak detection</td>
281      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm">N2670</a></td>
282      <td class="na" align="center">N/A</td>
283    </tr>
284    <tr>
285      <td>Allowing move constructors to throw [noexcept]</td>
286      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html">N3050</a></td>
287      <td class="full" align="center">Clang 3.0</td>
288    </tr>
289    <tr>
290      <td>Defining move special member functions</td>
291      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html">N3053</a></td>
292      <td class="full" align="center">Clang 3.0</td>
293    </tr>
294
295    <tr class="separator">
296      <th align="center" colspan="3">Concurrency</th>
297    </tr>
298    <tr>
299      <td>Sequence points</td>
300      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html">N2239</a></td>
301      <td class="none" align="center">No</td>
302    </tr>
303    <tr>
304      <td>Atomic operations</td>
305      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html">N2427</a></td>
306      <td class="full" align="center">Clang 3.1</td>
307    </tr>
308    <tr>
309      <td>Strong Compare and Exchange</td>
310      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2748.html">N2748</a></td>
311      <td class="full" align="center">Clang 3.1</td>
312    </tr>
313    <tr>
314      <td>Bidirectional Fences</td>
315      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm">N2752</a></td>
316      <td class="full" align="center">Clang 3.1</td>
317    </tr>
318
319    <tr>
320      <td>Memory model</td>
321      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm">N2429</a></td>
322      <td class="none" align="center">No</td>
323    </tr>
324    <tr>
325      <td>Data-dependency ordering: atomics and memory model</td>
326      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm">N2664</a></td>
327      <td class="none" align="center">No</td>
328    </tr>
329    <tr>
330      <td>Propagating exceptions</td>
331      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">N2179</a></td>
332      <td class="full" align="center">Clang 2.9</td>
333    </tr>
334    <tr>
335      <td>Abandoning a process and at_quick_exit</td>
336      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm">N2440</a></td>
337      <td class="na" align="center">N/A</td>
338    </tr>
339    <tr>
340      <td>Allow atomics use in signal handlers</td>
341      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm">N2547</a></td>
342      <td class="full" align="center">Clang 3.1</td>
343    </tr>
344    <tr>
345      <td>Thread-local storage</td>
346      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm">N2659</a></td>
347      <td class="none" align="center">No</td>
348    </tr>
349    <tr>
350      <td>Dynamic initialization and destruction with concurrency</td>
351      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm">N2660</a></td>
352      <td class="none" align="center">No</td>
353    </tr>
354
355    <tr class="separator">
356      <th align="center" colspan="3">C99 Features in C++11</th>
357    </tr>
358    <tr>
359      <td><code>__func__</code> predefined identifier</td>
360      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm">N2340</a></td>
361      <td class="full" align="center">Clang 2.9</td>
362    </tr>
363    <tr>
364      <td>C99 preprocessor</td>
365      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm">N1653</a></td>
366      <td class="full" align="center">Clang 2.9</td>
367    </tr>
368    <tr>
369      <td><code>long long</code></td>
370      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf">N1811</a></td>
371      <td class="full" align="center">Clang 2.9</td>
372    </tr>
373    <tr>
374      <td>Extended integral types</td>
375      <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf">N1988</a></td>
376      <td class="none" align="center">No</td>
377    </tr>
378</table>
379</div>
380</body>
381</html>
382