aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2007-12-05 07:24:19 +0000
committerAnders Carlsson <andersca@mac.com>2007-12-05 07:24:19 +0000
commitd35c832bca3c57a017d2b8cd5970be18e0f0a273 (patch)
tree7a3850e328facf1764ca8b233e651c3ae4358bab
parentc8ee7988c4ea9ec784625d2a47a8575feb191421 (diff)
Add sema checking for compound literal expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44605 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Sema/SemaExpr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index f53980ca90..b08695ff76 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -686,8 +686,11 @@ ActOnCompoundLiteral(SourceLocation LParenLoc, TypeTy *Ty,
// FIXME: put back this assert when initializers are worked out.
//assert((InitExpr != 0) && "ActOnCompoundLiteral(): missing expression");
Expr *literalExpr = static_cast<Expr*>(InitExpr);
-
- // FIXME: add semantic analysis (C99 6.5.2.5).
+
+ // FIXME: add more semantic analysis (C99 6.5.2.5).
+ if (CheckInitializer(literalExpr, literalType, false))
+ return 0;
+
return new CompoundLiteralExpr(literalType, literalExpr);
}