[cfe-commits] [libcxx] r124293 - /libcxx/trunk/include/__config

Douglas Gregor dgregor at apple.com
Wed Jan 26 07:39:56 PST 2011


Author: dgregor
Date: Wed Jan 26 09:39:56 2011
New Revision: 124293

URL: http://llvm.org/viewvc/llvm-project?rev=124293&view=rev
Log:
Inline namespaces are always available in Clang. Rely on that without
testing via __has_feature, since __has_feature for C++0x features no
longer evaluates true in C++98/03 mode.

Also, eliminate the redundant using directive. Inline namespaces make
their members visible in the enclosing namespace automatically.


Modified:
    libcxx/trunk/include/__config

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=124293&r1=124292&r2=124293&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Wed Jan 26 09:39:56 2011
@@ -148,22 +148,15 @@
 #define _LIBCPP_HAS_NO_TRAILING_RETURN
 #endif
 
-#if __has_feature(cxx_inline_namespaces)
+// Inline namespaces are available in Clang regardless of C++ dialect.
 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
 #define _LIBCPP_END_NAMESPACE_STD  } }
 #define _STD std::_LIBCPP_NAMESPACE
 
 namespace std {
-inline namespace _LIBCPP_NAMESPACE {
+  inline namespace _LIBCPP_NAMESPACE {
+  }
 }
-using namespace _LIBCPP_NAMESPACE;
-}
-
-#else  // __has_feature(cxx_inline_namespaces)
-#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
-#define _LIBCPP_END_NAMESPACE_STD }
-#define _STD std
-#endif  // __has_feature(cxx_inline_namespaces)
 
 #if !(__has_feature(cxx_constexpr))
 #define _LIBCPP_HAS_NO_CONSTEXPR





More information about the cfe-commits mailing list