blob: df01a05aed563909aa5d63b3324c841de2f711d9 [file] [log] [blame]
Cedric Venet3d658642009-02-14 20:20:19 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4<head>
Gabor Greif70f2a042009-02-25 15:22:45 +00005 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Chris Lattner900e32d2010-05-21 20:59:40 +00006 <title>Clang - C++ and C++'0x Status</title>
Gabor Greif70f2a042009-02-25 15:22:45 +00007 <link type="text/css" rel="stylesheet" href="menu.css">
8 <link type="text/css" rel="stylesheet" href="content.css">
Cedric Venet3d658642009-02-14 20:20:19 +00009 <style type="text/css">
Douglas Gregor01cf1122009-05-12 18:36:58 +000010 .na { background-color: #C0C0C0; text-align: center; }
Cedric Venet3d658642009-02-14 20:20:19 +000011 .broken { background-color: #C11B17 }
12 .basic { background-color: #F88017 }
13 .medium { background-color: #FDD017 }
14 .advanced { background-color: #347C17 }
15 .complete { background-color: #00FF00 }
16 </style>
17</head>
18<body>
19
20<!--#include virtual="menu.html.incl"-->
21
22<div id="content">
23
24<!--*************************************************************************-->
Chris Lattner900e32d2010-05-21 20:59:40 +000025<h1>C++ and C++'0x Support in Clang</h1>
Cedric Venet3d658642009-02-14 20:20:19 +000026<!--*************************************************************************-->
Douglas Gregor4c9b68f2009-06-27 19:33:58 +000027<p>Last updated: $Date$</p>
Cedric Venet3d658642009-02-14 20:20:19 +000028
Douglas Gregor57f1a002010-02-05 23:51:14 +000029 <ul>
30 <li><a href="#projects">Projects Building with Clang</a></li>
31 <li><a href="#specification">Implementation Status by Section</a></li>
32 <li><a href="#cxx0x">C++0x Status</a></li>
33 </ul>
34
Chris Lattner900e32d2010-05-21 20:59:40 +000035<p>Clang currently implements all of the ISO C++ 1998 standard (including
36 the defects addressed in the ISO C++ 2003 standard) except for 'export'.
37 However, the implementation of Clang C++ is still somewhat immature, with
38 remaining bugs that may cause compiler crashes, erroneous errors and warnings,
39 or miscompiled code. The <a href="http://llvm.org/bugs/">LLVM bug tracker</a>
40 contains a Clang C++ component that tracks known Clang C++ bugs.</p>
Douglas Gregor57f1a002010-02-05 23:51:14 +000041
Douglas Gregor15f2e722010-04-12 16:01:38 +000042 <h2 id="projects">Projects Building with Clang</h2>
Douglas Gregor57f1a002010-02-05 23:51:14 +000043
Chris Lattner900e32d2010-05-21 20:59:40 +000044 <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
46 Clang++.</p>
Douglas Gregor57f1a002010-02-05 23:51:14 +000047
48<table width="689" border="1" cellspacing="0">
49 <tr>
50 <th>Project</th>
51 <th>Status</th>
52 <th>Last Tested</th>
53 <th>Tracking Bug</th>
54 </tr>
55 <tr>
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>
58 <td>Continually</td>
59 <td></td>
60 </tr>
61 <tr>
Douglas Gregor95e636c2010-02-09 16:36:17 +000062 <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>
65 <td></td>
66 </tr>
67 <tr>
Chris Lattner900e32d2010-05-21 20:59:40 +000068 <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>
71 <td>May 20, 2010</td>
72 <td><a href="http://llvm.org/bugs/show_bug.cgi?id=6023">PR6023</a></td>
73 </tr>
74 <tr>
Anton Korobeynikov555d04f2010-02-09 16:50:54 +000075 <td><a href="http://qt.nokia.com">Qt</a></td>
Anton Korobeynikov04881242010-02-09 16:46:25 +000076 <td>Partially compiles; miscompilation of uic prevents complete compilation, qmake works, some small examples also.</td>
Douglas Gregor95e636c2010-02-09 16:36:17 +000077 <td>February 9, 2010</td>
78 <td><a href="http://llvm.org/bugs/show_bug.cgi?id=5881">PR5881</a></td>
79 </tr>
Douglas Gregor57f1a002010-02-05 23:51:14 +000080</table>
81
Chris Lattner900e32d2010-05-21 20:59:40 +000082<h2 id="cxx0x">C++0x Implementation status</h2>
83
84<p>Clang's development effort is focused primarily on fixing bugs in the current
85ISO C++ standard (1998/2003). This section tracks the status of various C++0x
Chris Lattnera4b46cc2010-05-21 21:02:17 +000086features.</p>
Chris Lattner900e32d2010-05-21 20:59:40 +000087
88
89<h2 id="specification">Implementation Status by Feature</h2>
Cedric Venet3d658642009-02-14 20:20:19 +000090
91
92<!-- Within this table: The colors we're using to color-code our level
93of support for a given section:
94
95 White (no background): not considered/tested.
96 #C11B17: Broken.
97 #F88017: Some useful examples work
98 #FDD017: Many examples work
99 #347C17: Nearly everything works
100 #00FF00 + check mark: Implementation complete!
101 -->
102
103<p>The following table is used to help track our implementation
Chris Lattner900e32d2010-05-21 20:59:40 +0000104 progress toward implementing the complete C++'0x standard. We use a
Cedric Venet3d658642009-02-14 20:20:19 +0000105 simple, somewhat arbitrary color-coding scheme to describe the
Chris Lattner900e32d2010-05-21 20:59:40 +0000106 relative completeness of features:</p>
Cedric Venet3d658642009-02-14 20:20:19 +0000107
108<table width="689" border="1" cellspacing="0">
109 <tr>
110 <th>Not started/not evaluated</th>
111 <th>Not Applicable</th>
112 <th>Broken</th>
113 <th>Some examples work</th>
114 <th>Many examples work</th>
115 <th>Nearly everything works</th>
Douglas Gregor07554022009-05-12 17:55:28 +0000116 <th>Complete</th>
117 <th>Complete (with tests for each paragraph)</th>
Cedric Venet3d658642009-02-14 20:20:19 +0000118 </tr>
119 <tr>
120 <td></td>
121 <td class="na">N/A</td>
122 <td class="broken"></td>
123 <td class="basic"></td>
124 <td class="medium"></td>
125 <td class="advanced"></td>
Douglas Gregor07554022009-05-12 17:55:28 +0000126 <td class="complete"></td>
Cedric Venet3d658642009-02-14 20:20:19 +0000127 <td class="complete" align="center">&#x2713;</td>
128 </tr>
129</table>
130
131<p>A feature is "complete" when the appropriate Clang component (Parse, AST,
132Sema, CodeGen) implements the behavior described in all of the
Chris Lattner900e32d2010-05-21 20:59:40 +0000133paragraphs in the relevant C++'0x draft standard. The major
134components are:</p>
Cedric Venet3d658642009-02-14 20:20:19 +0000135
136<dl>
137 <dt>Parse</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000138 <dd>Clang is able to parse the grammar of this feature (or the grammar
139 described by this section), but does not necessarily do anything with the
140 parsed result. Use Clang's <code>-fsyntax-only</code> option to parse C++
141 programs.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000142
143 <dt>AST</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000144 <dd>Clang builds an abstract syntax tree (AST) for the feature, but does not
145 necessarily perform any type-checking. Use Clang's <code>-ast-print</code>
146 option to print the resulting ASTs.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000147
148 <dt>Sema</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000149 <dd>Clang parses and type-checks this feature and provides a well-formed AST
150 annotated with types. Use Clang's <code>-fsyntax-only</code> to type-check
151 code.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000152
153 <dt>CodeGen</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000154 <dd>Clang parses, type-checks, and generates code for this feature, allowing
155 one to compile and execute programs.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000156</dl>
157
Chris Lattner900e32d2010-05-21 20:59:40 +0000158<p>Updates to this table are welcome! Tests for the various features are also
Cedric Venet3d658642009-02-14 20:20:19 +0000159welcome!</p>
160
161<table width="689" border="1" cellspacing="0">
Chris Lattner900e32d2010-05-21 20:59:40 +0000162<tr><td colspan="6" align="center" bgcolor="#ffffcc">C++0x Features</td>
163</tr>
Cedric Venet3d658642009-02-14 20:20:19 +0000164 <tr>
Chris Lattner900e32d2010-05-21 20:59:40 +0000165 <th>Feature</th>
Cedric Venet3d658642009-02-14 20:20:19 +0000166 <th>Parse</th>
167 <th>AST</th>
168 <th>Sema</th>
169 <th>CodeGen</th>
170 <th>Notes</th>
171 </tr>
Douglas Gregor6d507a62009-05-07 17:50:16 +0000172
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000173<tr>
Cedric Venet3d658642009-02-14 20:20:19 +0000174 <td>Explicit conversion operators (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437</a>)</td>
Douglas Gregor07554022009-05-12 17:55:28 +0000175 <td class="complete" align="center"></td>
Cedric Venet3d658642009-02-14 20:20:19 +0000176 <td class="medium" align="center"></td>
177 <td class="advanced" align="center"></td>
178 <td class="broken"></td>
179 <td>No name mangling; ASTs don't contain calls to conversion operators</td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000180</tr>
181<tr>
Anders Carlssonc31a0ce2009-03-16 17:28:26 +0000182 <td>Static assertions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.pdf">N1720</a>)</td>
Douglas Gregor07554022009-05-12 17:55:28 +0000183 <td class="complete" align="center"></td>
184 <td class="complete" align="center"></td>
185 <td class="complete" align="center"></td>
Anders Carlssonc31a0ce2009-03-16 17:28:26 +0000186 <td class="na">N/A</td>
187 <td></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000188</tr>
189<tr>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000190 <td>Deleted functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a>)</td>
Douglas Gregor07554022009-05-12 17:55:28 +0000191 <td class="complete" align="center"></td>
192 <td class="complete" align="center"></td>
193 <td class="complete" align="center"></td>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000194 <td class="na">N/A</td>
195 <td></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000196</tr>
197<tr>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000198 <td>Rvalue references (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html">N2118</a> + <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2831.html">N2831</a>)</td>
Douglas Gregor07554022009-05-12 17:55:28 +0000199 <td class="complete" align="center"></td>
200 <td class="complete" align="center"></td>
201 <td class="complete" align="center"></td>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000202 <td class="broken"></td>
203 <td></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000204</tr>
205<tr>
206 <td>nullptr (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf">N2431</a>)</td>
Douglas Gregor07554022009-05-12 17:55:28 +0000207 <td class="complete" align="center"></td>
208 <td class="complete" align="center"></td>
209 <td class="complete" align="center"></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000210 <td class="broken"></td>
211 <td></td>
Cedric Venet3d658642009-02-14 20:20:19 +0000212</tr>
Douglas Gregor7420c2d2009-06-15 16:50:45 +0000213<tr>
214 <td>Right angle brackets (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a>)</td>
215 <td class="complete" align="center"></td>
216 <td class="na" align="center">N/A</td>
217 <td class="na" align="center">N/A</td>
218 <td class="na">N/A</td>
219 <td></td>
220</tr>
Anders Carlsson3eb43a02009-06-24 22:10:19 +0000221<tr>
222 <td>Decltype (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a>)</td>
223 <td class="complete" align="center">&#x2713;</td>
224 <td class="complete" align="center">&#x2713;</td>
225 <td class="complete" align="center">&#x2713;</td>
226 <td class="na">N/A</td>
227 <td></td>
228</tr>
Cedric Venet3d658642009-02-14 20:20:19 +0000229</table>
Douglas Gregor01cf1122009-05-12 18:36:58 +0000230<br />
Cedric Venet3d658642009-02-14 20:20:19 +0000231</div>
232</body>
233</html>