1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <META http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
6 <title>Clang - C++ and C++'
0x 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 .category { background-color: #FFFFCC; text-align: center
; }
11 .na { background-color: #C0C0C0; text-align: center
; }
12 .broken { background-color: #C11B17 }
13 .basic { background-color: #F88017 }
14 .medium { background-color: #FDD017 }
15 .advanced { background-color: #347C17 }
16 .complete { background-color: #00FF00 }
21 <!--#include virtual="menu.html.incl"-->
25 <!--*************************************************************************-->
26 <h1>C++ and C++'
0x Support in Clang
</h1>
27 <!--*************************************************************************-->
28 <p>Last updated: $Date$
</p>
31 <li><a href=
"#projects">Projects Building with Clang
</a></li>
32 <li><a href=
"#specification">Implementation Status by Section
</a></li>
33 <li><a href=
"#cxx0x">C++
0x Status
</a></li>
36 <p>Clang currently implements all of the ISO C++
1998 standard (including
37 the defects addressed in the ISO C++
2003 standard) except for 'export'
38 (which has been removed from the C++'
0x draft).
39 The
<a href=
"http://llvm.org/bugs/">LLVM bug tracker
</a>
40 contains a Clang C++ component that tracks known Clang C++ bugs.
</p>
42 <h2 id=
"projects">Projects Building with Clang
</h2>
44 <p>Clang is now capable of compiling large C++ projects, and the following
45 table describes various projects that we have attempted to compile with
48 <table width=
"689" border=
"1" cellspacing=
"0">
56 <td><a href=
"http://clang.llvm.org">Clang
</a> and
<a href=
"http://llvm.org">LLVM
</a></td>
57 <td>Successful self-hosting achieved
</td>
62 <td><a href=
"http://www.cmake.org">CMake
</a></td>
63 <td>Compiles, passes regression tests (debug build)
</td>
64 <td>February
9,
2010</td>
68 <td><a href=
"http://www.boost.org">Boost
</a></td>
69 <td><a href=
"http://blog.llvm.org/2010/05/clang-builds-boost.html">Compiles
70 and passes regression tests
</a> on Darwin/X86-
64.
</td>
72 <td><a href=
"http://llvm.org/bugs/show_bug.cgi?id=6023"><del>PR6023
</del></a></td>
75 <td><a href=
"http://qt.nokia.com">Qt
</a></td>
76 <td>Partially compiles; miscompilation of uic prevents complete compilation, qmake works, some small examples also.
</td>
77 <td>February
9,
2010</td>
78 <td><a href=
"http://llvm.org/bugs/show_bug.cgi?id=5881">PR5881
</a></td>
82 <h2 id=
"cxx0x">C++
0x Implementation status
</h2>
84 <p>Clang's development effort is focused primarily on fixing bugs in the current
85 ISO C++ standard (
1998/
2003). This section tracks the status of various C++
0x
88 <p>You can use clang in C++
0x mode either
89 with
<a href=
"http://libcxx.llvm.org/">libc++
</a> or with gcc's libstdc++.
90 libstdc++-
4.4 requires
<a href=
"libstdc++4.4-clang0x.patch">a patch
</a> to work
91 with clang; other versions have not been tested.
</p>
94 <h2 id=
"specification">Implementation Status by Feature
</h2>
97 <!-- Within this table: The colors we're using to color-code our level
98 of support for a given section:
100 White (no background): not considered/tested.
102 #F88017: Some useful examples work
103 #FDD017: Many examples work
104 #347C17: Nearly everything works
105 #00FF00 + check mark: Implementation complete!
108 <p>The following table is used to help track our implementation
109 progress toward implementing the complete C++'
0x standard. We use a
110 simple, somewhat arbitrary color-coding scheme to describe the
111 relative completeness of features:
</p>
113 <table width=
"689" border=
"1" cellspacing=
"0">
115 <th>Not started/not evaluated
</th>
116 <th>Not Applicable
</th>
118 <th>Some examples work
</th>
119 <th>Many examples work
</th>
120 <th>Nearly everything works
</th>
123 <th>Complete (with tests for each paragraph)</th>
128 <td class=
"na">N/A
</td>
129 <td class=
"broken"></td>
130 <td class=
"basic"></td>
131 <td class=
"medium"></td>
132 <td class=
"advanced"></td>
133 <td class=
"complete">rXXXXXX
</td>
135 <td class="complete" align="center">✓</td>
140 <p>In addition, boxes marked with ✓ have complete and passing tests.
141 Similarly, boxes marked with ✗ have complete tests, some of which
142 are failing, and a
<b>?
</b> indicates partial tests while not making any
143 statement about passing status.
</p>
145 <p>A feature is
"complete" when the appropriate Clang component (Parse, AST,
146 Sema, CodeGen) implements the behavior described in all of the
147 paragraphs in the relevant C++'
0x draft standard. The major
152 <dd>Clang is able to parse the grammar of this feature (or the grammar
153 described by this section), but does not necessarily do anything with the
154 parsed result. Use Clang's
<code>-fsyntax-only
</code> option to parse C++
158 <dd>Clang builds an abstract syntax tree (AST) for the feature, but does not
159 necessarily perform any type-checking. Use Clang's
<code>-ast-print
</code>
160 option to print the resulting ASTs.
</dd>
163 <dd>Clang parses and type-checks this feature and provides a well-formed AST
164 annotated with types. Use Clang's
<code>-fsyntax-only
</code> to type-check
168 <dd>Clang parses, type-checks, and generates code for this feature, allowing
169 one to compile and execute programs.
</dd>
172 <p>Updates to this table are welcome! Tests for the various features are also
175 <table width=
"689" border=
"1" cellspacing=
"0">
176 <tr><td colspan=
"7" align=
"center" bgcolor=
"#ffddaa">C++
0x Features (current draft report
<a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3291.pdf">here
</a>)
</td>
184 <th>Standard Sections
</th>
187 <tr><td colspan=
"7" class=
"category">Control Flow Modifications
</td></tr>
189 <td>Range-based for loop
</td>
190 <td class=
"complete" align=
"center">✓</td>
191 <td class=
"complete" align=
"center">✓</td>
192 <td class=
"complete" align=
"center">✓</td>
193 <td class=
"complete" align=
"center">✓</td>
195 <td><a href=
"http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2007/n2243.html">N2243
</a>
196 <a href=
"http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2011/n3271.htm">N3271
</a></td>
199 <tr><td colspan=
"7" class=
"category">Type System Modifications
</td></tr>
201 <td>rvalue references
</td>
202 <td class=
"complete" align=
"center"></td>
203 <td class=
"complete" align=
"center"></td>
204 <td class=
"complete" align=
"center"></td>
205 <td class=
"complete"></td>
207 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">N2118
</a>,
208 <a href=
"http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2831.html">N2831
</a> <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm">N2439
</a>
213 <td class=
"complete" align=
"center">✓</td>
214 <td class=
"complete" align=
"center">✓</td>
215 <td class=
"advanced" align=
"center"></td>
216 <td class=
"na">N/A
</td>
218 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343
</a>
219 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1478.pdf">N1478
</a>
220 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1978.pdf">N1978
</a>
224 <td>auto type deduction
</td>
225 <td class=
"complete" align=
"center">✓</td>
226 <td class=
"complete" align=
"center">✓</td>
227 <td class=
"complete" align=
"center">✓</td>
228 <td class=
"complete" align=
"center">✓</td>
229 <td>7.1.6.2,
7.1.6.4</td>
230 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf">N1984
</a></td>
234 <td class=
"complete" align=
"center"></td>
235 <td class=
"complete" align=
"center"></td>
236 <td class=
"medium" align=
"center"></td>
237 <td class=
"broken"></td>
238 <td>2.14.7,
4.10,
4.11</td>
239 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">N2431
</a>
240 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1488.pdf">N1488
</a>
241 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2214.pdf">N2214
</a>
245 <td>enum classes
</td>
246 <td class=
"complete"></td>
247 <td class=
"advanced"></td>
248 <td class=
"advanced"></td>
251 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1513.pdf">N1513
</a>
252 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf">N2347
</a>
253 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2499.pdf">N2499
</a>
254 Includes forward declaration capability
259 <td class=
"complete"></td>
260 <td class=
"complete"></td>
261 <td class=
"complete"></td>
262 <td class=
"complete"></td>
265 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf">N1811
</a>
274 <td>3.6.2,
3.9,
5.19,
7.1.5</td>
275 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1521.pdf">N1521
</a>
276 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf">N2235
</a>
280 <td>char16_t/char32_t
</td>
281 <td class=
"medium"></td>
282 <td class=
"medium"></td>
283 <td class=
"medium"></td>
284 <td class=
"medium"></td>
286 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html">N2249
</a></td>
289 <td>Unicode string literal types
</td>
294 <td>2.14.3,
2.14.5</td>
298 <td>Raw string literal types
</td>
304 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2053.html">N2053
</a>
305 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.html">N2442
</a>
306 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2378.pdf">N2378
</a>
310 <td>user-defined literal types
</td>
316 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2378.pdf">N2378
</a></td>
319 <td>POD definition changes
</td>
325 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2294.html">N2294
</a></td>
328 <td>Unrestricted unions
</td>
334 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf">N2544
</a></td>
337 <td>Tighter narrowing rules
</td>
343 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1890.pdf">N1890
</a>
344 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2215.pdf">N2215
</a>
345 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf">N2640
</a>
348 <tr><td colspan=
"7" class=
"category">Class Modifications
</td></tr>
350 <td>delegating constructors
</td>
356 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986">N1986
</a></td>
359 <td>inheriting constructors
</td>
365 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1890.pdf">N1890
</a>
366 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1898.pdf">N1898
</a>
367 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2512.html">N2512
</a>
371 <td>In-declaration member initialization
</td>
377 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2628.html">N2628
</a></td>
380 <td>Changes to implicitly generated methods
</td>
386 <td>Includes implicit generation of move operations
</td>
389 <td>defaulted methods
</td>
395 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1717.pdf">N1717
</a>
396 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.html">N2326
</a>
400 <td>destructor defaults to noexcept
</td>
409 <td>sizeof on members without object instance
</td>
415 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2150.html">N2150
</a></td>
418 <td>virtual function safety modifications
</td>
427 <td>Explicit conversion operators
</td>
428 <td class=
"complete" align=
"center"></td>
429 <td class=
"basic" align=
"center"></td>
430 <td class=
"basic" align=
"center"></td>
431 <td class=
"broken"></td>
433 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437
</a>
434 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2333.html">N2333
</a>
435 No name mangling; ASTs don't contain calls to conversion operators
</td>
437 <tr><td colspan=
"7" class=
"category">Template Modifications
</td></tr>
439 <td>Right angle brackets
</td>
440 <td class=
"complete" align=
"center"></td>
441 <td class=
"na" align=
"center">N/A
</td>
442 <td class=
"na" align=
"center">N/A
</td>
443 <td class=
"na">N/A
</td>
445 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757
</a></td>
448 <td>variadic templates
</td>
449 <td class=
"complete" align=
"center"></td>
450 <td class=
"complete" align=
"center"></td>
451 <td class=
"complete" align=
"center"></td>
452 <td class=
"complete" align=
"center"></td>
454 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2080.pdf">N2080
</a>
455 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2087.pdf">N2087
</a>
456 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf">N2242
</a>
457 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2488.pdf">N2488
</a>
458 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">N2555
</a>
462 <td>template aliases
</td>
463 <td class=
"basic"></td>
464 <td class=
"basic"></td>
465 <td class=
"basic"></td>
467 <td>7.1.3,
14.6.7</td>
468 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1489.pdf">N1489
</a>
469 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf">N2258
</a>
470 Only non-template type aliases implemented
474 <td>Removal of export
</td>
475 <td class=
"complete"></td>
476 <td class=
"na">N/A
</td>
477 <td class=
"na">N/A
</td>
478 <td class=
"na">N/A
</td>
480 <td>This was never implemented in C++
03</td>
483 <td>extern templates
</td>
484 <td class=
"complete"></td>
485 <td class=
"complete"></td>
486 <td class=
"complete"></td>
487 <td class=
"complete"></td>
489 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm">N1987
</a></td>
492 <td>Local classes as template parameters
</td>
498 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2402.pdf">N2402
</a>
499 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm">N2657
</a>
502 <tr><td colspan=
"7" class=
"category">Exception Modifications
</td></tr>
504 <td>Deprecation of exception specifications
</td>
514 <td class=
"complete" align=
"center">✓</td>
515 <td class=
"complete" align=
"center">✓</td>
516 <td class=
"complete" align=
"center">✓</td>
517 <td class=
"na">N/A
</td>
519 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html">N3050
</a></td>
521 <tr><td colspan=
"7" class=
"category">Preprocessor Modifications
</td></tr>
523 <td>__STDC_HOSTED__
</td>
524 <td class=
"complete"></td>
525 <td class=
"na">N/A
</td>
526 <td class=
"na">N/A
</td>
527 <td class=
"na">N/A
</td>
530 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568
</a>
535 <td class=
"complete"></td>
536 <td class=
"na">N/A
</td>
537 <td class=
"na">N/A
</td>
538 <td class=
"na">N/A
</td>
541 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568
</a>
545 <td>Variable argument macros
</td>
546 <td class=
"complete"></td>
547 <td class=
"na">N/A
</td>
548 <td class=
"na">N/A
</td>
549 <td class=
"na">N/A
</td>
552 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568
</a>
556 <td>Empty macro arguments
</td>
557 <td class=
"complete"></td>
558 <td class=
"na">N/A
</td>
559 <td class=
"na">N/A
</td>
560 <td class=
"na">N/A
</td>
563 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568
</a>
568 <td class=
"complete"></td>
569 <td class=
"na">N/A
</td>
570 <td class=
"na">N/A
</td>
571 <td class=
"na">N/A
</td>
574 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1568.htm">N1568
</a>
579 <td class=
"complete"></td>
580 <td class=
"na">N/A
</td>
581 <td class=
"na">N/A
</td>
582 <td class=
"na">N/A
</td>
586 <tr><td colspan=
"7" class=
"category">Things Completely New
</td></tr>
588 <td>Late-specified return type
</td>
589 <td class=
"complete" align=
"center">✓</td>
590 <td class=
"complete" align=
"center">✓</td>
591 <td class=
"complete" align=
"center">✓</td>
592 <td class=
"basic"></td>
594 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2445.html">N2445
</a></td>
597 <td>lambda expressions
</td>
603 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1968.htm">N1968
</a>
604 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2550.pdf">N2550
</a>
605 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2859.pdf">N2859
</a>
609 <td>Uniform initializers
</td>
615 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2215.pdf">N2215
</a>
616 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2640.pdf">N2640
</a>
620 <td>Memory model
</td>
626 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2556.html">N2556
</a></td>
628 <tr><td colspan=
"7" class=
"category">Miscellania
</td></tr>
630 <td>Standard attribute syntax
</td>
636 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2418.pdf">N2418
</a></td>
639 <td>alignment control
</td>
648 <td>Deleted functions
</td>
649 <td class=
"complete" align=
"center"></td>
650 <td class=
"complete" align=
"center"></td>
651 <td class=
"medium" align=
"center"></td>
652 <td class=
"na">N/A
</td>
654 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2326.htm">N2326
</a></br>
655 This also includes class methods.
</td>
658 <td>static_assert
</td>
659 <td class=
"complete" align=
"center"></td>
660 <td class=
"complete" align=
"center"></td>
661 <td class=
"advanced" align=
"center"></td>
662 <td class=
"na">N/A
</td>
664 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1381.htm">N1381
</a>
665 <a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.pdf">N1720
</a>
669 <td>Inline namespaces
</td>
670 <td class=
"complete" align=
"center">✓</td>
671 <td class=
"complete" align=
"center">✓</td>
672 <td class=
"complete" align=
"center">✓</td>
673 <td class=
"complete" align=
"center">N/A
</td>
675 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">N2535
</a></td>
678 <td>thread_local storage
</td>
683 <td>3.7.2,
7.1.1</td>
684 <td><a href=
"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm">N2660
</a></td>
686 <tr><td colspan=
"7" class=
"category">Standard Library Modifications, see
<a href=
"http://libcxx.llvm.org/index.html">libc++
</a> or
<a href=
"http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x">libstdc++
</a> or
<a href=
"http://blogs.msdn.com/b/vcblog/archive/2010/07/02/video-introduction-to-the-stl-part-1.aspx">VC++
2010</a></td></tr>