From: Sebastian Redl
Date: Tue, 31 Aug 2010 23:28:47 +0000 (+0000)
Subject: Implement __has_feature(cxx_inline_namespaces)
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6c09775819cf851d71750bfc056dfe39ce801e1;p=clang
Implement __has_feature(cxx_inline_namespaces)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112671 91177308-0d34-0410-b5e6-96231b3b80d8
---
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html
index 838b65f27b..75a4608993 100644
--- a/docs/LanguageExtensions.html
+++ b/docs/LanguageExtensions.html
@@ -40,6 +40,7 @@ td {
C++0x static_assert()
C++0x type inference
C++0x variadic templates
+ C++0x inline namespaces
Blocks
Function Overloading in C
@@ -301,32 +302,34 @@ not yet implemented will be noted.
C++0x attributes
Use __has_feature(cxx_attributes) 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.
C++0x deleted functions
Use __has_feature(cxx_deleted_functions) to determine if support for
-deleted function definitions (with = delete) is enabled.
+deleted function definitions (with = delete) is enabled.
C++ TR concepts
Use __has_feature(cxx_concepts) 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.
C++0x lambdas
Use __has_feature(cxx_lambdas) 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.
C++0x nullptr
Use __has_feature(cxx_nullptr) to determine if support for
-nullptr is enabled. clang does not yet fully implement this feature.
+nullptr is enabled. clang does not yet fully implement this
+feature.
C++0x rvalue references
Use __has_feature(cxx_rvalue_references) 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.
C++0x static_assert()
@@ -339,12 +342,17 @@ compile-time assertions using static_assert is enabled.
is supported using the auto specifier. If this is disabled,
auto will instead be a storage class specifier, as in C or C++98.
-C++0x variadic templates
+C++0x variadic templates
Use __has_feature(cxx_variadic_templates) 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.
+C++0x inline namespaces
+
+Use __has_feature(cxx_inline_namespaces) to determine if support for
+inline namespaces is enabled.
+
Blocks
diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp
index 9654104d4d..9015c278fc 100644
--- a/lib/Lex/PPMacroExpansion.cpp
+++ b/lib/Lex/PPMacroExpansion.cpp
@@ -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)
diff --git a/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp
index 650e577ca7..cc2ae28c58 100644
--- a/test/Lexer/has_feature_cxx0x.cpp
+++ b/test/Lexer/has_feature_cxx0x.cpp
@@ -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