From f10e43020c2763b9f1c98be3308c480b6a91b8ba Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Thu, 6 Aug 2015 07:59:26 +0000 Subject: [PATCH] Fix Visual C++ error C2248: 'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>::additionalSizeToAlloc' : cannot access protected member declared in class 'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>' I'm not sure how this compiles with gcc. Aren't protecteded members accessible only with protected or public inheritance? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244199 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Support/TrailingObjectsTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unittests/Support/TrailingObjectsTest.cpp b/unittests/Support/TrailingObjectsTest.cpp index fe1fbf15307..41e2d4181f5 100644 --- a/unittests/Support/TrailingObjectsTest.cpp +++ b/unittests/Support/TrailingObjectsTest.cpp @@ -16,7 +16,7 @@ namespace { // This class, beyond being used by the test case, a nice // demonstration of the intended usage of TrailingObjects, with a // single trailing array. -class Class1 final : private TrailingObjects { +class Class1 final : protected TrailingObjects { friend TrailingObjects; unsigned NumShorts; @@ -47,7 +47,7 @@ public: // Here, there are two singular optional object types appended. // Note that it fails to compile without the alignment spec. -class LLVM_ALIGNAS(8) Class2 final : private TrailingObjects { +class LLVM_ALIGNAS(8) Class2 final : protected TrailingObjects { friend TrailingObjects; bool HasShort, HasDouble; -- 2.34.1