<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Clang - C++ Support</title>
<link type="text/css" rel="stylesheet" href="menu.css" />
<link type="text/css" rel="stylesheet" href="content.css" />
<style type="text/css">
</style>
</head>
<body>
<!--#include virtual="menu.html.incl"-->
<div id="content">
<!--*************************************************************************-->
<h1>C++ Support in Clang</h1>
<!--*************************************************************************-->
<p>
This page tracks the status of C++ support in Clang.<br>
Currently most of the C++ features are missing; here you can find features that are at least partially supported in Clang. </p>
<!-- Within this table: The colors we're using to color-code our level
of support for a given section:
White (no background): not considered/tested.
#C11B17: Broken.
#F88017: Some useful examples work
#FDD017: Many examples work
#347C17: Nearly everything works
#00FF00 + check mark: Implementation complete!
-->
<p>The following table is used to help track our implementation
progress toward implementing the complete C++03 standard. We use a
simple, somewhat arbitrary color-coding scheme to describe the
relatively completeness of features by section:</p>
<table width="689" border="1" cellspacing="0">
<tr>
<th>Not started/not evaluated</th>
<th>Not Applicable</th>
<th>Broken</th>
<th>Some examples work</th>
<th>Many examples work</th>
<th>Nearly everything works</th>
<th>Complete!</th>
</tr>
<tr>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C11B17"></td>
<td bgcolor="#F88017"></td>
<td bgcolor="#FDD017"></td>
<td bgcolor="#347C17"></td>
<td bgcolor="#00FF00" align="center">✓</td>
</tr>
</table>
<p>A feature is "complete" when the appropriate Clang component (Parse, AST,
Sema, CodeGen) implements the behavior described in all of the
paragraphs in the relevant C++ standard. Note that many C++ features are
actually described in several different sections within the standard. The major components are:</p>
<dl>
<dt>Parse</dt>
<dd>Clang is able to parse the grammar of this feature (or the grammar described by this section), but does not necessarily do anything with the parsed result. Use Clang's <code>-fsyntax-only</code> option to parse C++ programs.</dd>
<dt>AST</dt>
<dd>Clang builds an abstract syntax tree (AST) for the feature, but does not necessarily perform any type-checking. Use Clang's <code>-ast-print</code> option to print the resulting ASTs.</dd>
<dt>Sema</dt>
<dd>Clang parses and type-checks this feature and provides a well-formed AST annotated with types. Use Clang's <code>-fsyntax-only</code> to type-check code.</dd>
<dt>CodeGen</dt>
<dd>Clang parses, type-checks, and generates code for this feature, allowing one to compile and execute programs.</dd>
</dl>
<p>Updates to this table are welcome! Since Clang already supports
much of C, and therefore much C++, many of the currently-white cells
could be filled in. If you wish to do so, please compare Clang's
implementation against the C++ standard and provide a patch that
updates the table accordingly. Tests for the various features are also
welcome!</p>
<table width="689" border="1" cellspacing="0">
<tr>
<th>Section</th>
<th>Parse</th>
<th>AST</th>
<th>Sema</th>
<th>CodeGen</th>
<th>Notes</th>
</tr>
<tr>
<td>2 [lex]</td>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td></td>
</tr>
<tr>
<td> 2.1 [lex.phases]</td>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td></td>
</tr>
<tr>
<td> 2.2 [lex.charset]</td>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td></td>
</tr>
<tr>
<td> 2.3 [lex.trigraph]</td>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td></td>
</tr>
<tr>
<td> 2.4 [lex.pptoken]</td>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td></td>
</tr>
<tr>
<td> 2.5 [lex.digraph]</td>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td></td>
</tr>
<tr>
<td> 2.6 [lex.token]</td>
<td></td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0">N/A</td>
<td bgcolor="#C0C0C0"