diff options
Diffstat (limited to 'docs/LanguageExtensions.html')
-rw-r--r-- | docs/LanguageExtensions.html | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html index 414d9c8..e2a44ea 100644 --- a/docs/LanguageExtensions.html +++ b/docs/LanguageExtensions.html @@ -28,6 +28,19 @@ td { <li><a href="#cxx_exceptions">C++ exceptions</a></li> <li><a href="#cxx_rtti">C++ RTTI</a></li> </ul> +<li><a href="#checking_upcoming_features">Checks for Upcoming Standard Language Features</a></li> + <ul> + <li><a href="#cxx_attributes">C++0x attributes</a></li> + <li><a href="#cxx_decltype">C++0x <tt>decltype()</tt></a></li> + <li><a href="#cxx_deleted_functions">C++0x deleted functions</a></li> + <li><a href="#cxx_concepts">C++ TR concepts</a></li> + <li><a href="#cxx_lambdas">C++0x lambdas</a></li> + <li><a href="#cxx_nullptr">C++0x nullptr</a></li> + <li><a href="#cxx_rvalue_references">C++0x rvalue references</a></li> + <li><a href="#cxx_static_assert">C++0x <tt>static_assert()</tt></a></li> + <li><a href="#cxx_auto_type">C++0x type inference</a></li> + <li><a href="#cxx_variadic_templates">C++0x variadic templates</a></li> + </ul> <li><a href="#blocks">Blocks</a></li> <li><a href="#overloading-in-c">Function Overloading in C</a></li> <li><a href="#builtins">Builtin Functions</a> @@ -216,6 +229,70 @@ example, compiling code with <tt>-fexceptions</tt> enables C++ exceptions.</p> compiling code with <tt>-fno-rtti</tt> disables the use of RTTI.</p> <!-- ======================================================================= --> +<h2 id="checking_upcoming_features">Checks for Upcoming Standard Language Features</h2> +<!-- ======================================================================= --> + +<p>The <tt>__has_feature</tt> macro can be used to query if certain upcoming +standard language features are enabled. Those features are listed here.</p> + +<p>Currently, all features listed here are slated for inclusion in the upcoming +C++0x standard. As a result, all the features that clang supports are enabled +with the <tt>-std=c++0x</tt> option when compiling C++ code. Features that are +not yet implemented will be noted.</p> + +<h3 id="cxx_decltype">C++0x <tt>decltype()</tt></h3> + +<p>Use <tt>__has_feature(cxx_decltype)</tt> to determine if support for the +<tt>decltype()</tt> specifier is enabled.</p> + +<h3 id="cxx_attributes">C++0x attributes</h3> + +<p>Use <tt>__has_feature(cxx_attributes)</tt> to determine if support for +attribute parsing with C++0x's square bracket notation is enabled. + +<h3 id="cxx_deleted_functions">C++0x deleted functions</tt></h3> + +<p>Use <tt>__has_feature(cxx_deleted_functions)</tt> to determine if support for +deleted function definitions (with <tt>= delete</tt>) is enabled. + +<h3 id="cxx_concepts">C++ TR <tt>concepts</tt></h3> + +<p>Use <tt>__has_feature(cxx_lambdas)</tt> to determine if support for +concepts is enabled. clang does not currently implement this feature. + +<h3 id="cxx_lambdas">C++0x lambdas</h3> + +<p>Use <tt>__has_feature(cxx_lambdas)</tt> to determine if support for +lambdas is enabled. clang does not currently implement this feature. + +<h3 id="cxx_nullptr">C++0x <tt>nullptr</tt></h3> + +<p>Use <tt>__has_feature(cxx_nullptr)</tt> to determine if support for +<tt>nullptr</tt> is enabled. clang does not yet fully implement this feature. + +<h3 id="cxx_rvalue_references">C++0x rvalue references</tt></h3> + +<p>Use <tt>__has_feature(cxx_rvalue_references)</tt> to determine if support for +rvalue references is enabled. clang does not yet fully implement this feature. + +<h3 id="cxx_static_assert">C++0x <tt>static_assert()</tt></h3> + +<p>Use <tt>__has_feature(cxx_static_assert)</tt> to determine if support for +compile-time assertions using <tt>static_assert</tt> is enabled.</p> + +<h3 id="cxx_auto_type">C++0x type inference</h3> + +<p>Use <tt>__has_feature(cxx_auto_type)</tt> to determine C++0x type inference +is supported using the <tt>auto</tt> specifier. If this is disabled, +<tt>auto</tt> will instead be a storage class specifier, as in C or C++98.</p> + +<h3 id="cxx_variadic_templates">C++0x variadic templates</tt></h3> + +<p>Use <tt>__has_feature(cxx_variadic_templates)</tt> to determine if support +for templates taking any number of arguments with the ellipsis notation is +enabled. clang does not yet fully implement this feature.</p> + +<!-- ======================================================================= --> <h2 id="blocks">Blocks</h2> <!-- ======================================================================= --> |