]> granicus.if.org Git - clang/commitdiff
Implement __has_feature(cxx_inline_namespaces)
authorSebastian Redl <sebastian.redl@getdesigned.at>
Tue, 31 Aug 2010 23:28:47 +0000 (23:28 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Tue, 31 Aug 2010 23:28:47 +0000 (23:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112671 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LanguageExtensions.html
lib/Lex/PPMacroExpansion.cpp
test/Lexer/has_feature_cxx0x.cpp

index 838b65f27b81da517358e1f1460a47b1ffdb84a8..75a4608993e9efbf9ea46c390abc86325a477759 100644 (file)
@@ -40,6 +40,7 @@ td {
   <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>
+  <li><a href="#cxx_inline_namespaces">C++0x inline namespaces</a></li>
   </ul>
 <li><a href="#blocks">Blocks</a></li>
 <li><a href="#overloading-in-c">Function Overloading in C</a></li>
@@ -301,32 +302,34 @@ not yet implemented will be noted.</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.
+attribute parsing with C++0x's square bracket notation is enabled.</p>
 
 <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.
+deleted function definitions (with <tt>= delete</tt>) is enabled.</p>
 
 <h3 id="cxx_concepts">C++ TR concepts</h3>
 
 <p>Use <tt>__has_feature(cxx_concepts)</tt> to determine if support for
-concepts is enabled. clang does not currently implement this feature.
+concepts is enabled. clang does not currently implement this feature.</p>
 
 <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.
+lambdas is enabled. clang does not currently implement this feature.</p>
 
 <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.
+<tt>nullptr</tt> is enabled. clang does not yet fully implement this
+feature.</p>
 
 <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.
+rvalue references is enabled. clang does not yet fully implement this
+feature.</p>
 
 <h3 id="cxx_static_assert">C++0x <tt>static_assert()</tt></h3>
 
@@ -339,12 +342,17 @@ compile-time assertions using <tt>static_assert</tt> is enabled.</p>
 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>
+<h3 id="cxx_variadic_templates">C++0x variadic templates</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>
 
+<h3 id="cxx_inline_namespaces">C++0x inline namespaces</h3>
+
+<p>Use <tt>__has_feature(cxx_inline_namespaces)</tt> to determine if support for
+inline namespaces is enabled.</p>
+
 <!-- ======================================================================= -->
 <h2 id="blocks">Blocks</h2>
 <!-- ======================================================================= -->
index 9654104d4d22e036e3560bc55bb088ebf8f22c73..9015c278fc921e74752b65bf24a032ac89ed49ce 100644 (file)
@@ -523,6 +523,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
            .Case("ownership_holds", true)
            .Case("ownership_returns", true)
            .Case("ownership_takes", true)
+           .Case("cxx_inline_namespaces", true)
          //.Case("cxx_concepts", false)
          //.Case("cxx_lambdas", false)
          //.Case("cxx_nullptr", false)
index 650e577ca72c83f5816d37976337916a6400c322..cc2ae28c58b052381a28e53e22b65e2c5357889f 100644 (file)
@@ -99,3 +99,13 @@ int no_variadic_templates();
 
 // CHECK-0X: no_variadic_templates
 // CHECK-NO-0X: no_variadic_templates
+
+
+#if __has_feature(cxx_inline_namespaces)
+int inline_namespaces();
+#else
+int no_inline_namespaces();
+#endif
+
+// CHECK-0X: inline_namespaces
+// CHECK-NO-0X: inline_namespaces