diff options
author | Anders Carlsson <andersca@mac.com> | 2007-12-05 07:24:19 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2007-12-05 07:24:19 +0000 |
commit | d35c832bca3c57a017d2b8cd5970be18e0f0a273 (patch) | |
tree | 7a3850e328facf1764ca8b233e651c3ae4358bab | |
parent | c8ee7988c4ea9ec784625d2a47a8575feb191421 (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.cpp | 7 |
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); } |