blob: 654c6a759197cdba674e4f241ec51b39eefaca91 [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
86features. In general, the implementations of these features are far less
87developed than C++98/03 features.</p>
88
89
90<h2 id="specification">Implementation Status by Feature</h2>
Cedric Venet3d658642009-02-14 20:20:19 +000091
92
93<!-- Within this table: The colors we're using to color-code our level
94of support for a given section:
95
96 White (no background): not considered/tested.
97 #C11B17: Broken.
98 #F88017: Some useful examples work
99 #FDD017: Many examples work
100 #347C17: Nearly everything works
101 #00FF00 + check mark: Implementation complete!
102 -->
103
104<p>The following table is used to help track our implementation
Chris Lattner900e32d2010-05-21 20:59:40 +0000105 progress toward implementing the complete C++'0x standard. We use a
Cedric Venet3d658642009-02-14 20:20:19 +0000106 simple, somewhat arbitrary color-coding scheme to describe the
Chris Lattner900e32d2010-05-21 20:59:40 +0000107 relative completeness of features:</p>
Cedric Venet3d658642009-02-14 20:20:19 +0000108
109<table width="689" border="1" cellspacing="0">
110 <tr>
111 <th>Not started/not evaluated</th>
112 <th>Not Applicable</th>
113 <th>Broken</th>
114 <th>Some examples work</th>
115 <th>Many examples work</th>
116 <th>Nearly everything works</th>
Douglas Gregor07554022009-05-12 17:55:28 +0000117 <th>Complete</th>
118 <th>Complete (with tests for each paragraph)</th>
Cedric Venet3d658642009-02-14 20:20:19 +0000119 </tr>
120 <tr>
121 <td></td>
122 <td class="na">N/A</td>
123 <td class="broken"></td>
124 <td class="basic"></td>
125 <td class="medium"></td>
126 <td class="advanced"></td>
Douglas Gregor07554022009-05-12 17:55:28 +0000127 <td class="complete"></td>
Cedric Venet3d658642009-02-14 20:20:19 +0000128 <td class="complete" align="center">&#x2713;</td>
129 </tr>
130</table>
131
132<p>A feature is "complete" when the appropriate Clang component (Parse, AST,
133Sema, CodeGen) implements the behavior described in all of the
Chris Lattner900e32d2010-05-21 20:59:40 +0000134paragraphs in the relevant C++'0x draft standard. The major
135components are:</p>
Cedric Venet3d658642009-02-14 20:20:19 +0000136
137<dl>
138 <dt>Parse</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000139 <dd>Clang is able to parse the grammar of this feature (or the grammar
140 described by this section), but does not necessarily do anything with the
141 parsed result. Use Clang's <code>-fsyntax-only</code> option to parse C++
142 programs.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000143
144 <dt>AST</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000145 <dd>Clang builds an abstract syntax tree (AST) for the feature, but does not
146 necessarily perform any type-checking. Use Clang's <code>-ast-print</code>
147 option to print the resulting ASTs.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000148
149 <dt>Sema</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000150 <dd>Clang parses and type-checks this feature and provides a well-formed AST
151 annotated with types. Use Clang's <code>-fsyntax-only</code> to type-check
152 code.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000153
154 <dt>CodeGen</dt>
Chris Lattner900e32d2010-05-21 20:59:40 +0000155 <dd>Clang parses, type-checks, and generates code for this feature, allowing
156 one to compile and execute programs.</dd>
Cedric Venet3d658642009-02-14 20:20:19 +0000157</dl>
158
Chris Lattner900e32d2010-05-21 20:59:40 +0000159<p>Updates to this table are welcome! Tests for the various features are also
Cedric Venet3d658642009-02-14 20:20:19 +0000160welcome!</p>
161
162<table width="689" border="1" cellspacing="0">
Chris Lattner900e32d2010-05-21 20:59:40 +0000163<tr><td colspan="6" align="center" bgcolor="#ffffcc">C++0x Features</td>
164</tr>
Cedric Venet3d658642009-02-14 20:20:19 +0000165 <tr>
Chris Lattner900e32d2010-05-21 20:59:40 +0000166 <th>Feature</th>
Cedric Venet3d658642009-02-14 20:20:19 +0000167 <th>Parse</th>
168 <th>AST</th>
169 <th>Sema</th>
170 <th>CodeGen</th>
171 <th>Notes</th>
172 </tr>
Douglas Gregor6d507a62009-05-07 17:50:16 +0000173
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000174<tr>
Cedric Venet3d658642009-02-14 20:20:19 +0000175 <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 +0000176 <td class="complete" align="center"></td>
Cedric Venet3d658642009-02-14 20:20:19 +0000177 <td class="medium" align="center"></td>
178 <td class="advanced" align="center"></td>
179 <td class="broken"></td>
180 <td>No name mangling; ASTs don't contain calls to conversion operators</td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000181</tr>
182<tr>
Anders Carlssonc31a0ce2009-03-16 17:28:26 +0000183 <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 +0000184 <td class="complete" align="center"></td>
185 <td class="complete" align="center"></td>
186 <td class="complete" align="center"></td>
Anders Carlssonc31a0ce2009-03-16 17:28:26 +0000187 <td class="na">N/A</td>
188 <td></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000189</tr>
190<tr>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000191 <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 +0000192 <td class="complete" align="center"></td>
193 <td class="complete" align="center"></td>
194 <td class="complete" align="center"></td>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000195 <td class="na">N/A</td>
196 <td></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000197</tr>
198<tr>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000199 <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 +0000200 <td class="complete" align="center"></td>
201 <td class="complete" align="center"></td>
202 <td class="complete" align="center"></td>
Sebastian Redl0b5e7fb2009-04-12 17:41:24 +0000203 <td class="broken"></td>
204 <td></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000205</tr>
206<tr>
207 <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 +0000208 <td class="complete" align="center"></td>
209 <td class="complete" align="center"></td>
210 <td class="complete" align="center"></td>
Sebastian Redl6e8ed162009-05-10 18:38:11 +0000211 <td class="broken"></td>
212 <td></td>
Cedric Venet3d658642009-02-14 20:20:19 +0000213</tr>
Douglas Gregor7420c2d2009-06-15 16:50:45 +0000214<tr>
215 <td>Right angle brackets (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html">N1757</a>)</td>
216 <td class="complete" align="center"></td>
217 <td class="na" align="center">N/A</td>
218 <td class="na" align="center">N/A</td>
219 <td class="na">N/A</td>
220 <td></td>
221</tr>
Anders Carlsson3eb43a02009-06-24 22:10:19 +0000222<tr>
223 <td>Decltype (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a>)</td>
224 <td class="complete" align="center">&#x2713;</td>
225 <td class="complete" align="center">&#x2713;</td>
226 <td class="complete" align="center">&#x2713;</td>
227 <td class="na">N/A</td>
228 <td></td>
229</tr>
Cedric Venet3d658642009-02-14 20:20:19 +0000230</table>
Douglas Gregor01cf1122009-05-12 18:36:58 +0000231<br />
Cedric Venet3d658642009-02-14 20:20:19 +0000232</div>
233</body>
234</html>