diff options
author | John McCall <rjmccall@apple.com> | 2011-01-19 11:48:09 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-01-19 11:48:09 +0000 |
commit | 2998d6b0e6d5476c473f68012a851fe4a0f609c8 (patch) | |
tree | 1595af6e401aabe07cddee4015bebea0ba1a1fdd /lib/Sema/SemaDeclCXX.cpp | |
parent | 3b6575108a5b6d8b92ac3a9a7794bf6c3a210907 (diff) |
When building the copy expression for a __block variable, make sure
there's a respectable point of instantiation. Also, make sure we do
this operation even when instantiating a dependently-typed variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123818 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index fd8d1e1e82..b2749bf6ce 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -5641,16 +5641,7 @@ void Sema::AddCXXDirectInitializerToDecl(Decl *RealDecl, VDecl->setInit(Result.takeAs<Expr>()); VDecl->setCXXDirectInitializer(true); - if (!VDecl->isInvalidDecl() && - !VDecl->getDeclContext()->isDependentContext() && - VDecl->hasGlobalStorage() && !VDecl->isStaticLocal() && - !VDecl->getInit()->isConstantInitializer(Context, - VDecl->getType()->isReferenceType())) - Diag(VDecl->getLocation(), diag::warn_global_constructor) - << VDecl->getInit()->getSourceRange(); - - if (const RecordType *Record = VDecl->getType()->getAs<RecordType>()) - FinalizeVarWithDestructor(VDecl, Record); + CheckCompleteVariableDeclaration(VDecl); } /// \brief Given a constructor and the set of arguments provided for the |