From 71d5a2540a98c81f5bcaeb48805e0e2881f530ef Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:01:22 +0000 Subject: Vendor import of llvm trunk r300422: https://llvm.org/svn/llvm-project/llvm/trunk@300422 --- unittests/Support/TrailingObjectsTest.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'unittests/Support/TrailingObjectsTest.cpp') diff --git a/unittests/Support/TrailingObjectsTest.cpp b/unittests/Support/TrailingObjectsTest.cpp index cb5c47d1b25b..23acc54d2376 100644 --- a/unittests/Support/TrailingObjectsTest.cpp +++ b/unittests/Support/TrailingObjectsTest.cpp @@ -236,3 +236,24 @@ TEST(TrailingObjects, Realignment) { reinterpret_cast(C + 1) + 1, alignof(long)))); } } + +// Test the use of TrailingObjects with a template class. This +// previously failed to compile due to a bug in MSVC's member access +// control/lookup handling for OverloadToken. +template +class Class5Tmpl : private llvm::TrailingObjects { + using TrailingObjects = typename llvm::TrailingObjects; + friend TrailingObjects; + + size_t numTrailingObjects( + typename TrailingObjects::template OverloadToken) const { + return 1; + } + + size_t numTrailingObjects( + typename TrailingObjects::template OverloadToken) const { + return 2; + } +}; + +class Class5 : public Class5Tmpl {}; -- cgit v1.2.3