]> granicus.if.org Git - clang/commitdiff
MSVC doesn't require an accessible copy-constructor when binding a temporary class...
authorFrancois Pichet <pichet2000@gmail.com>
Fri, 31 Dec 2010 10:43:42 +0000 (10:43 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Fri, 31 Dec 2010 10:43:42 +0000 (10:43 +0000)
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

lib/Sema/SemaInit.cpp

index 3cca42e48b75925123384ddd118b723fa9d8f40a..e453b0a4edfdc81ad01aa1d3e1dc9cc3f27ca83d 100644 (file)
@@ -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)