]> granicus.if.org Git - llvm/commitdiff
Try once again to fix the MSVC build of AlignedCharArrayUnion
authorReid Kleckner <rnk@google.com>
Tue, 10 Jan 2017 01:05:33 +0000 (01:05 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 10 Jan 2017 01:05:33 +0000 (01:05 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291519 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/AlignOf.h

index de2f1add0b1ea436a362a50a764e3ca2aba8b0ab..2d8297ee87d0ccfa9b3c22bc38ff5232471d05ea 100644 (file)
@@ -106,6 +106,7 @@ LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128)
 // 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, typename... Ts> constexpr size_t sizer() {
   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, typename... Ts> constexpr size_t sizer() {
 /// 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