From: Francois Pichet Date: Fri, 31 Dec 2010 10:43:42 +0000 (+0000) Subject: MSVC doesn't require an accessible copy-constructor when binding a temporary class... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f57258bb96799957085080027a9c9eefe36c3417;p=clang MSVC doesn't require an accessible copy-constructor when binding a temporary class object to a const-reference. Note: this is not a C++0x behavior change, it was already like that in MSVC 2003. This fixes a compile error when parsing MSVC header files with clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122644 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 3cca42e48b..e453b0a4ed 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -2610,7 +2610,7 @@ static void TryReferenceInitialization(Sema &S, // // The constructor that would be used to make the copy shall // be callable whether or not the copy is actually done. - if (!S.getLangOptions().CPlusPlus0x) + if (!S.getLangOptions().CPlusPlus0x && !S.getLangOptions().Microsoft) Sequence.AddExtraneousCopyToTemporary(cv2T2); if (DerivedToBase)