[llvm] r291519 - Try once again to fix the MSVC build of AlignedCharArrayUnion

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 17:05:33 PST 2017


Author: rnk
Date: Mon Jan  9 19:05:33 2017
New Revision: 291519

URL: http://llvm.org/viewvc/llvm-project?rev=291519&view=rev
Log:
Try once again to fix the MSVC build of AlignedCharArrayUnion

It was complaining about ambiguity between llvm::detail and
llvm::support::detail:
  error C2872: 'detail': ambiguous symbol
  note: could be 'llvm::detail'
  note: or       'llvm::support::detail'

Standardize on llvm::support::detail to hide these symbols further.

Modified:
    llvm/trunk/include/llvm/Support/AlignOf.h

Modified: llvm/trunk/include/llvm/Support/AlignOf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/AlignOf.h?rev=291519&r1=291518&r2=291519&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/AlignOf.h (original)
+++ llvm/trunk/include/llvm/Support/AlignOf.h Mon Jan  9 19:05:33 2017
@@ -106,6 +106,7 @@ LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
 // That is supported by Visual Studio 2015 and GCC 5.1.
 // Once these are the baselines for LLVM, we can use std::aligned_union instead.
 
+namespace support {
 namespace detail {
 template <typename T1> constexpr size_t aligner() { return alignof(T1); }
 
@@ -120,6 +121,7 @@ template <typename T1, typename T2, type
   return (sizeof(T1) > sizer<T2, Ts...>()) ? sizeof(T1) : sizer<T2, Ts...>();
 }
 } // end namespace detail
+} // end namespace support
 
 /// \brief This union template exposes a suitably aligned and sized character
 /// array member which can hold elements of any of a number of types.
@@ -129,8 +131,8 @@ template <typename T1, typename T2, type
 /// a placement new of any of these types.
 template <typename... Ts>
 struct AlignedCharArrayUnion
-    : llvm::AlignedCharArray<detail::aligner<Ts...>(),
-                             detail::sizer<Ts...>()> {};
+    : llvm::AlignedCharArray<support::detail::aligner<Ts...>(),
+                             support::detail::sizer<Ts...>()> {};
 } // end namespace llvm
 
 #endif // LLVM_SUPPORT_ALIGNOF_H




More information about the llvm-commits mailing list