From a6e053e61a4dd1f71e6d90c5265c252fe846523b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 15 Dec 2010 01:34:56 +0000 Subject: Variadic templates: extend the Expr class with a bit that specifies whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831 --- clang/lib/Sema/SemaStmt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaStmt.cpp') diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 6c212a7eb82..2c7ff5bd47b 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -32,7 +32,9 @@ using namespace sema; StmtResult Sema::ActOnExprStmt(FullExprArg expr) { Expr *E = expr.get(); - assert(E && "ActOnExprStmt(): missing expression"); + if (!E) // FIXME: FullExprArg has no error state? + return StmtError(); + // C99 6.8.3p2: The expression in an expression statement is evaluated as a // void expression for its side effects. Conversion to void allows any // operand, even incomplete types. -- cgit v1.2.3