Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
Gabor Greif | 70f2a04 | 2009-02-25 15:22:45 +0000 | [diff] [blame] | 5 | <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 6 | <title>Clang - C++ and C++'0x Status</title> |
Gabor Greif | 70f2a04 | 2009-02-25 15:22:45 +0000 | [diff] [blame] | 7 | <link type="text/css" rel="stylesheet" href="menu.css"> |
| 8 | <link type="text/css" rel="stylesheet" href="content.css"> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 9 | <style type="text/css"> |
Douglas Gregor | 01cf112 | 2009-05-12 18:36:58 +0000 | [diff] [blame] | 10 | .na { background-color: #C0C0C0; text-align: center; } |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 11 | .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 Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 25 | <h1>C++ and C++'0x Support in Clang</h1> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 26 | <!--*************************************************************************--> |
Douglas Gregor | 4c9b68f | 2009-06-27 19:33:58 +0000 | [diff] [blame] | 27 | <p>Last updated: $Date$</p> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 28 | |
Douglas Gregor | 57f1a00 | 2010-02-05 23:51:14 +0000 | [diff] [blame] | 29 | <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 Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 35 | <p>Clang currently implements all of the ISO C++ 1998 standard (including |
Chris Lattner | d3573f0 | 2010-05-21 21:16:21 +0000 | [diff] [blame] | 36 | the defects addressed in the ISO C++ 2003 standard) except for 'export' |
| 37 | (which has been removed from the C++'0x draft). |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 38 | However, the implementation of Clang C++ is still somewhat immature, with |
| 39 | remaining bugs that may cause compiler crashes, erroneous errors and warnings, |
| 40 | or miscompiled code. The <a href="http://llvm.org/bugs/">LLVM bug tracker</a> |
| 41 | contains a Clang C++ component that tracks known Clang C++ bugs.</p> |
Douglas Gregor | 57f1a00 | 2010-02-05 23:51:14 +0000 | [diff] [blame] | 42 | |
Douglas Gregor | 15f2e72 | 2010-04-12 16:01:38 +0000 | [diff] [blame] | 43 | <h2 id="projects">Projects Building with Clang</h2> |
Douglas Gregor | 57f1a00 | 2010-02-05 23:51:14 +0000 | [diff] [blame] | 44 | |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 45 | <p>Clang is now capable of compiling large C++ projects, and the following |
| 46 | table describes various projects that we have attempted to compile with |
| 47 | Clang++.</p> |
Douglas Gregor | 57f1a00 | 2010-02-05 23:51:14 +0000 | [diff] [blame] | 48 | |
| 49 | <table width="689" border="1" cellspacing="0"> |
| 50 | <tr> |
| 51 | <th>Project</th> |
| 52 | <th>Status</th> |
| 53 | <th>Last Tested</th> |
| 54 | <th>Tracking Bug</th> |
| 55 | </tr> |
| 56 | <tr> |
| 57 | <td><a href="http://clang.llvm.org">Clang</a> and <a href="http://llvm.org">LLVM</a></td> |
| 58 | <td>Successful self-hosting achieved</td> |
| 59 | <td>Continually</td> |
| 60 | <td></td> |
| 61 | </tr> |
| 62 | <tr> |
Douglas Gregor | 95e636c | 2010-02-09 16:36:17 +0000 | [diff] [blame] | 63 | <td><a href="http://www.cmake.org">CMake</a></td> |
| 64 | <td>Compiles, passes regression tests (debug build)</td> |
| 65 | <td>February 9, 2010</td> |
| 66 | <td></td> |
| 67 | </tr> |
| 68 | <tr> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 69 | <td><a href="http://www.boost.org">Boost</a></td> |
| 70 | <td><a href="http://blog.llvm.org/2010/05/clang-builds-boost.html">Compiles |
| 71 | and passes regression tests</a> on Darwin/X86-64.</td> |
| 72 | <td>May 20, 2010</td> |
Gabor Greif | 0ca08af | 2010-08-26 14:20:18 +0000 | [diff] [blame] | 73 | <td><a href="http://llvm.org/bugs/show_bug.cgi?id=6023"><del>PR6023</del></a></td> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 74 | </tr> |
| 75 | <tr> |
Anton Korobeynikov | 555d04f | 2010-02-09 16:50:54 +0000 | [diff] [blame] | 76 | <td><a href="http://qt.nokia.com">Qt</a></td> |
Anton Korobeynikov | 0488124 | 2010-02-09 16:46:25 +0000 | [diff] [blame] | 77 | <td>Partially compiles; miscompilation of uic prevents complete compilation, qmake works, some small examples also.</td> |
Douglas Gregor | 95e636c | 2010-02-09 16:36:17 +0000 | [diff] [blame] | 78 | <td>February 9, 2010</td> |
| 79 | <td><a href="http://llvm.org/bugs/show_bug.cgi?id=5881">PR5881</a></td> |
| 80 | </tr> |
Douglas Gregor | 57f1a00 | 2010-02-05 23:51:14 +0000 | [diff] [blame] | 81 | </table> |
| 82 | |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 83 | <h2 id="cxx0x">C++0x Implementation status</h2> |
| 84 | |
| 85 | <p>Clang's development effort is focused primarily on fixing bugs in the current |
| 86 | ISO C++ standard (1998/2003). This section tracks the status of various C++0x |
Chris Lattner | a4b46cc | 2010-05-21 21:02:17 +0000 | [diff] [blame] | 87 | features.</p> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 88 | |
| 89 | |
| 90 | <h2 id="specification">Implementation Status by Feature</h2> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 91 | |
| 92 | |
| 93 | <!-- Within this table: The colors we're using to color-code our level |
| 94 | of 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 Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 105 | progress toward implementing the complete C++'0x standard. We use a |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 106 | simple, somewhat arbitrary color-coding scheme to describe the |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 107 | relative completeness of features:</p> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 108 | |
| 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 Gregor | 0755402 | 2009-05-12 17:55:28 +0000 | [diff] [blame] | 117 | <th>Complete</th> |
| 118 | <th>Complete (with tests for each paragraph)</th> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 119 | </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 Gregor | 0755402 | 2009-05-12 17:55:28 +0000 | [diff] [blame] | 127 | <td class="complete"></td> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 128 | <td class="complete" align="center">✓</td> |
| 129 | </tr> |
| 130 | </table> |
| 131 | |
| 132 | <p>A feature is "complete" when the appropriate Clang component (Parse, AST, |
| 133 | Sema, CodeGen) implements the behavior described in all of the |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 134 | paragraphs in the relevant C++'0x draft standard. The major |
| 135 | components are:</p> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 136 | |
| 137 | <dl> |
| 138 | <dt>Parse</dt> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 139 | <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 Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 143 | |
| 144 | <dt>AST</dt> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 145 | <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 Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 148 | |
| 149 | <dt>Sema</dt> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 150 | <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 Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 153 | |
| 154 | <dt>CodeGen</dt> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 155 | <dd>Clang parses, type-checks, and generates code for this feature, allowing |
| 156 | one to compile and execute programs.</dd> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 157 | </dl> |
| 158 | |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 159 | <p>Updates to this table are welcome! Tests for the various features are also |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 160 | welcome!</p> |
| 161 | |
| 162 | <table width="689" border="1" cellspacing="0"> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 163 | <tr><td colspan="6" align="center" bgcolor="#ffffcc">C++0x Features</td> |
| 164 | </tr> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 165 | <tr> |
Chris Lattner | 900e32d | 2010-05-21 20:59:40 +0000 | [diff] [blame] | 166 | <th>Feature</th> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 167 | <th>Parse</th> |
| 168 | <th>AST</th> |
| 169 | <th>Sema</th> |
| 170 | <th>CodeGen</th> |
| 171 | <th>Notes</th> |
| 172 | </tr> |
Douglas Gregor | 6d507a6 | 2009-05-07 17:50:16 +0000 | [diff] [blame] | 173 | |
Sebastian Redl | 6e8ed16 | 2009-05-10 18:38:11 +0000 | [diff] [blame] | 174 | <tr> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 175 | <td>Explicit conversion operators (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf">N2437</a>)</td> |
Douglas Gregor | 0755402 | 2009-05-12 17:55:28 +0000 | [diff] [blame] | 176 | <td class="complete" align="center"></td> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 177 | <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 Redl | 6e8ed16 | 2009-05-10 18:38:11 +0000 | [diff] [blame] | 181 | </tr> |
| 182 | <tr> |
Anders Carlsson | c31a0ce | 2009-03-16 17:28:26 +0000 | [diff] [blame] | 183 | <td>Static assertions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.pdf">N1720</a>)</td> |
Douglas Gregor | 0755402 | 2009-05-12 17:55:28 +0000 | [diff] [blame] | 184 | <td class="complete" align="center"></td> |
| 185 | <td class="complete" align="center"></td> |
| 186 | <td class="complete" align="center"></td> |
Anders Carlsson | c31a0ce | 2009-03-16 17:28:26 +0000 | [diff] [blame] | 187 | <td class="na">N/A</td> |
| 188 | <td></td> |
Sebastian Redl | 6e8ed16 | 2009-05-10 18:38:11 +0000 | [diff] [blame] | 189 | </tr> |
| 190 | <tr> |
Sebastian Redl | 0b5e7fb | 2009-04-12 17:41:24 +0000 | [diff] [blame] | 191 | <td>Deleted functions (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm">N2346</a>)</td> |
Douglas Gregor | 0755402 | 2009-05-12 17:55:28 +0000 | [diff] [blame] | 192 | <td class="complete" align="center"></td> |
| 193 | <td class="complete" align="center"></td> |
| 194 | <td class="complete" align="center"></td> |
Sebastian Redl | 0b5e7fb | 2009-04-12 17:41:24 +0000 | [diff] [blame] | 195 | <td class="na">N/A</td> |
| 196 | <td></td> |
Sebastian Redl | 6e8ed16 | 2009-05-10 18:38:11 +0000 | [diff] [blame] | 197 | </tr> |
| 198 | <tr> |
Sebastian Redl | 0b5e7fb | 2009-04-12 17:41:24 +0000 | [diff] [blame] | 199 | <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 Gregor | 0755402 | 2009-05-12 17:55:28 +0000 | [diff] [blame] | 200 | <td class="complete" align="center"></td> |
| 201 | <td class="complete" align="center"></td> |
| 202 | <td class="complete" align="center"></td> |
Sebastian Redl | 0b5e7fb | 2009-04-12 17:41:24 +0000 | [diff] [blame] | 203 | <td class="broken"></td> |
| 204 | <td></td> |
Sebastian Redl | 6e8ed16 | 2009-05-10 18:38:11 +0000 | [diff] [blame] | 205 | </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 Gregor | 0755402 | 2009-05-12 17:55:28 +0000 | [diff] [blame] | 208 | <td class="complete" align="center"></td> |
| 209 | <td class="complete" align="center"></td> |
| 210 | <td class="complete" align="center"></td> |
Sebastian Redl | 6e8ed16 | 2009-05-10 18:38:11 +0000 | [diff] [blame] | 211 | <td class="broken"></td> |
| 212 | <td></td> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 213 | </tr> |
Douglas Gregor | 7420c2d | 2009-06-15 16:50:45 +0000 | [diff] [blame] | 214 | <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 Carlsson | 3eb43a0 | 2009-06-24 22:10:19 +0000 | [diff] [blame] | 222 | <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">✓</td> |
| 225 | <td class="complete" align="center">✓</td> |
| 226 | <td class="complete" align="center">✓</td> |
| 227 | <td class="na">N/A</td> |
| 228 | <td></td> |
| 229 | </tr> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 230 | </table> |
Douglas Gregor | 01cf112 | 2009-05-12 18:36:58 +0000 | [diff] [blame] | 231 | <br /> |
Cedric Venet | 3d65864 | 2009-02-14 20:20:19 +0000 | [diff] [blame] | 232 | </div> |
| 233 | </body> |
| 234 | </html> |