Skip to content
Snippets Groups Projects
Commit 56209ffe authored by Douglas Gregor's avatar Douglas Gregor
Browse files

Add __has_feature(cxx_reference_qualified_functions); update tests and

documentation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124322 91177308-0d34-0410-b5e6-96231b3b80d8
parent b145ee6c
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,7 @@ td { ...@@ -39,6 +39,7 @@ td {
<li><a href="#cxx_lambdas">C++0x lambdas</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_nullptr">C++0x nullptr</a></li>
<li><a href="#cxx_rvalue_references">C++0x rvalue references</a></li> <li><a href="#cxx_rvalue_references">C++0x rvalue references</a></li>
<li><a href="#cxx_reference_qualified_functions">C++0x reference-qualified functions</a></li>
<li><a href="#cxx_static_assert">C++0x <tt>static_assert()</tt></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_auto_type">C++0x type inference</a></li>
<li><a href="#cxx_variadic_templates">C++0x variadic templates</a></li> <li><a href="#cxx_variadic_templates">C++0x variadic templates</a></li>
...@@ -423,11 +424,13 @@ lambdas is enabled. clang does not currently implement this feature.</p> ...@@ -423,11 +424,13 @@ lambdas is enabled. clang does not currently implement this feature.</p>
<tt>nullptr</tt> is enabled. clang does not yet fully implement this <tt>nullptr</tt> is enabled. clang does not yet fully implement this
feature.</p> feature.</p>
<h3 id="cxx_reference_qualified_functions">C++0x reference-qualified functions</h3>
<p>Use <tt>__has_feature(cxx_reference_qualified_functions)</tt> to determine if support for reference-qualified functions (e.g., member functions with <code>&amp;</code> or <code>&amp;&amp;</code> applied to <code>*this</code>) is enabled.</p>
<h3 id="cxx_rvalue_references">C++0x rvalue references</tt></h3> <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 <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 rvalue references is enabled. </p>
feature.</p>
<h3 id="cxx_static_assert">C++0x <tt>static_assert()</tt></h3> <h3 id="cxx_static_assert">C++0x <tt>static_assert()</tt></h3>
...@@ -438,7 +441,8 @@ compile-time assertions using <tt>static_assert</tt> is enabled.</p> ...@@ -438,7 +441,8 @@ compile-time assertions using <tt>static_assert</tt> is enabled.</p>
<p>Use <tt>__has_feature(cxx_auto_type)</tt> to determine C++0x type inference <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, 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> <tt>auto</tt> will instead be a storage class specifier, as in C or C++98.
Clang does not currently implement this feature.</p>
<h3 id="cxx_variadic_templates">C++0x variadic templates</h3> <h3 id="cxx_variadic_templates">C++0x variadic templates</h3>
......
...@@ -556,6 +556,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { ...@@ -556,6 +556,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
.Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x) .Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x)
//.Case("cxx_lambdas", false) //.Case("cxx_lambdas", false)
//.Case("cxx_nullptr", false) //.Case("cxx_nullptr", false)
.Case("cxx_reference_qualified_functions", LangOpts.CPlusPlus0x)
.Case("cxx_rvalue_references", LangOpts.CPlusPlus0x) .Case("cxx_rvalue_references", LangOpts.CPlusPlus0x)
.Case("cxx_strong_enums", LangOpts.CPlusPlus0x) .Case("cxx_strong_enums", LangOpts.CPlusPlus0x)
.Case("cxx_static_assert", LangOpts.CPlusPlus0x) .Case("cxx_static_assert", LangOpts.CPlusPlus0x)
......
...@@ -99,3 +99,13 @@ int no_inline_namespaces(); ...@@ -99,3 +99,13 @@ int no_inline_namespaces();
// CHECK-0X: has_inline_namespaces // CHECK-0X: has_inline_namespaces
// CHECK-NO-0X: no_inline_namespaces // CHECK-NO-0X: no_inline_namespaces
#if __has_feature(cxx_reference_qualified_functions)
int has_reference_qualified_functions();
#else
int no_reference_qualified_functions();
#endif
// CHECK-0X: has_reference_qualified_functions
// CHECK-NO-0X: no_reference_qualified_functions
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment