diff options
author | James Y Knight <jyknight@google.com> | 2021-02-24 13:51:00 -0500 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2021-02-24 13:56:49 -0500 |
commit | c2487bf7dfdda59b775b3d5a06684af243790125 (patch) | |
tree | 37b2602575efbfd219790325d35deaed972e039c /llvm | |
parent | e339bba637b941c8e78057319b7654c4babf18cb (diff) | |
download | llvm-c2487bf7dfdda59b775b3d5a06684af243790125.zip llvm-c2487bf7dfdda59b775b3d5a06684af243790125.tar.gz llvm-c2487bf7dfdda59b775b3d5a06684af243790125.tar.bz2 |
Remove a workaround for MSVC 2013, now that MSVC 2017 is the minimum.
In MSVC 2013, 'alignas(integer-template-arg)' didn't compile; verified
on godbolt that this now works properly.
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Support/TrailingObjects.h | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/llvm/include/llvm/Support/TrailingObjects.h b/llvm/include/llvm/Support/TrailingObjects.h index aaee0c4..f9e711a 100644 --- a/llvm/include/llvm/Support/TrailingObjects.h +++ b/llvm/include/llvm/Support/TrailingObjects.h @@ -88,23 +88,6 @@ protected: template <typename T> struct OverloadToken {}; }; -template <int Align> -class TrailingObjectsAligner : public TrailingObjectsBase {}; -template <> -class alignas(1) TrailingObjectsAligner<1> : public TrailingObjectsBase {}; -template <> -class alignas(2) TrailingObjectsAligner<2> : public TrailingObjectsBase {}; -template <> -class alignas(4) TrailingObjectsAligner<4> : public TrailingObjectsBase {}; -template <> -class alignas(8) TrailingObjectsAligner<8> : public TrailingObjectsBase {}; -template <> -class alignas(16) TrailingObjectsAligner<16> : public TrailingObjectsBase { -}; -template <> -class alignas(32) TrailingObjectsAligner<32> : public TrailingObjectsBase { -}; - // Just a little helper for transforming a type pack into the same // number of a different type. e.g.: // ExtractSecondType<Foo..., int>::type @@ -204,8 +187,8 @@ protected: // The base case of the TrailingObjectsImpl inheritance recursion, // when there's no more trailing types. template <int Align, typename BaseTy, typename TopTrailingObj, typename PrevTy> -class TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy> - : public TrailingObjectsAligner<Align> { +class alignas(Align) TrailingObjectsImpl<Align, BaseTy, TopTrailingObj, PrevTy> + : public TrailingObjectsBase { protected: // This is a dummy method, only here so the "using" doesn't fail -- // it will never be called, because this function recurses backwards @@ -290,8 +273,8 @@ public: #ifndef _MSC_VER using ParentType::OverloadToken; #else - // MSVC bug prevents the above from working, at least up through CL - // 19.10.24629. + // An MSVC bug prevents the above from working, (last tested at CL version + // 19.28). "Class5" in TrailingObjectsTest.cpp tests the problematic case. template <typename T> using OverloadToken = typename ParentType::template OverloadToken<T>; #endif |