[libcxx] r302800 - Replace a nested namespace used for overload resolution with a struct. Richard Smith says that using the namespace results in an ODR violation, but I disagree. Nevertheless, the struct works just as well.

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Thu May 11 07:00:54 PDT 2017


Author: marshall
Date: Thu May 11 09:00:54 2017
New Revision: 302800

URL: http://llvm.org/viewvc/llvm-project?rev=302800&view=rev
Log:
Replace a nested namespace used for overload resolution with a struct. Richard Smith says that using the namespace results in an ODR violation, but I disagree. Nevertheless, the struct works just as well.

Modified:
    libcxx/trunk/include/memory

Modified: libcxx/trunk/include/memory
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/memory?rev=302800&r1=302799&r2=302800&view=diff
==============================================================================
--- libcxx/trunk/include/memory (original)
+++ libcxx/trunk/include/memory Thu May 11 09:00:54 2017
@@ -996,11 +996,11 @@ struct __rebind_pointer {
 
 // allocator_traits
 
-namespace __has_pointer_type_imp
+struct __has_pointer_type_imp
 {
     template <class _Up> static __two __test(...);
     template <class _Up> static char __test(typename _Up::pointer* = 0);
-}
+};
 
 template <class _Tp>
 struct __has_pointer_type




More information about the cfe-commits mailing list