davide created this revision. davide added a reviewer: rsmith. davide added a subscriber: cfe-commits.
This has been disabled for a long time, but: 1) Initializers work (and apparently they're re reason why this was disabled). 2) various tests happen to hit this code path and the invariant seems to be always verified. I propose to add this back, it may be useful to catch mistakes. http://reviews.llvm.org/D12110 Files: lib/Sema/SemaExpr.cpp Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -5085,8 +5085,7 @@ Sema::ActOnCompoundLiteral(SourceLocation LParenLoc, ParsedType Ty, SourceLocation RParenLoc, Expr *InitExpr) { assert(Ty && "ActOnCompoundLiteral(): missing type"); - // FIXME: put back this assert when initializers are worked out. - //assert((InitExpr != 0) && "ActOnCompoundLiteral(): missing expression"); + assert((InitExpr != 0) && "ActOnCompoundLiteral(): missing expression"); TypeSourceInfo *TInfo; QualType literalType = GetTypeFromParser(Ty, &TInfo);
Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -5085,8 +5085,7 @@ Sema::ActOnCompoundLiteral(SourceLocation LParenLoc, ParsedType Ty, SourceLocation RParenLoc, Expr *InitExpr) { assert(Ty && "ActOnCompoundLiteral(): missing type"); - // FIXME: put back this assert when initializers are worked out. - //assert((InitExpr != 0) && "ActOnCompoundLiteral(): missing expression"); + assert((InitExpr != 0) && "ActOnCompoundLiteral(): missing expression"); TypeSourceInfo *TInfo; QualType literalType = GetTypeFromParser(Ty, &TInfo);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits