From: Anders Carlsson Date: Wed, 27 May 2009 16:28:34 +0000 (+0000) Subject: Relax an assert to an if check. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c520cf417e7a4eceeefef0a8b2a2b33811f0481;p=clang Relax an assert to an if check. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72477 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 3fae86d19d..951aaa3bc0 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -165,9 +165,9 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType, return true; // FIXME: What do do if VD is null here? - assert(VD && "Must have a var decl to construct into!"); - Init = CXXConstructExpr::Create(Context, VD, DeclType, Constructor, - false, &Init, 1); + if (VD) + Init = CXXConstructExpr::Create(Context, VD, DeclType, Constructor, + false, &Init, 1); return false; }