diff options
author | Chris Lattner <sabre@nondot.org> | 2007-12-18 07:02:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-12-18 07:02:56 +0000 |
commit | 78e34a00f49d512f3350a7c1687d0f0cfd520d03 (patch) | |
tree | c99941f2226db8e61d343ee4f639cffb73ab12fa /clang/Sema/SemaDecl.cpp | |
parent | e2dbba58285ceb674af65aef901ed07e39b7e472 (diff) | |
download | bcm5719-llvm-78e34a00f49d512f3350a7c1687d0f0cfd520d03.tar.gz bcm5719-llvm-78e34a00f49d512f3350a7c1687d0f0cfd520d03.zip |
Fix const propagation bug.
llvm-svn: 45152
Diffstat (limited to 'clang/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/Sema/SemaDecl.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp index c3b6a8c4d23..c3726725f8f 100644 --- a/clang/Sema/SemaDecl.cpp +++ b/clang/Sema/SemaDecl.cpp @@ -601,8 +601,7 @@ bool Sema::CheckInitializer(Expr *&Init, QualType &DeclType, bool isStatic) { // C99 6.7.8p3: The type of the entity to be initialized shall be an array // of unknown size ("[]") or an object type that is not a variable array type. if (const VariableArrayType *VAT = DeclType->getAsVariableArrayType()) { - Expr *expr = VAT->getSizeExpr(); - if (expr) + if (const Expr *expr = VAT->getSizeExpr()) return Diag(expr->getLocStart(), diag::err_variable_object_no_init, expr->getSourceRange()); |