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