From: Reid Kleckner Date: Tue, 10 Jan 2017 01:05:33 +0000 (+0000) Subject: Try once again to fix the MSVC build of AlignedCharArrayUnion X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edab6023d7456634df58dafc3eece2281f1d627e;p=llvm 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291519 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/AlignOf.h b/include/llvm/Support/AlignOf.h index de2f1add0b1..2d8297ee87d 100644 --- a/include/llvm/Support/AlignOf.h +++ b/include/llvm/Support/AlignOf.h @@ -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 constexpr size_t aligner() { return alignof(T1); } @@ -120,6 +121,7 @@ template constexpr size_t sizer() { return (sizeof(T1) > sizer()) ? sizeof(T1) : sizer(); } } // 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 constexpr size_t sizer() { /// a placement new of any of these types. template struct AlignedCharArrayUnion - : llvm::AlignedCharArray(), - detail::sizer()> {}; + : llvm::AlignedCharArray(), + support::detail::sizer()> {}; } // end namespace llvm #endif // LLVM_SUPPORT_ALIGNOF_H