diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-24 21:09:25 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-24 21:09:25 +0000 |
commit | f86fcb341116e72c5497e6b57695f46eca5f29e9 (patch) | |
tree | b5b71795cbb6ef9a270172a53d91bade7b5c443e /lib/Sema/SemaInit.cpp | |
parent | 34a2d384c745ebc39cae45dc1c0c4a6a7012e09b (diff) |
When we attempt to create a temporary object of class type, be sure
that the type we're copying is complete.
Boost.Regex now builds, although it's failing its regression tests
with our favorite "Sema doesn't consider destructor as used."
assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r-- | lib/Sema/SemaInit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index d552b16399..ea430bbd3e 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -3232,7 +3232,11 @@ static Sema::OwningExprResult CopyObject(Sema &S, Loc = CurInitExpr->getLocStart(); break; } - + + // Make sure that the type we are copying is complete. + if (S.RequireCompleteType(Loc, T, S.PDiag(diag::err_temp_copy_incomplete))) + return move(CurInit); + // Perform overload resolution using the class's copy constructors. DeclarationName ConstructorName = S.Context.DeclarationNames.getCXXConstructorName( |