Index: clang/lib/AST/ExprConstant.cpp =================================================================== --- clang/lib/AST/ExprConstant.cpp +++ clang/lib/AST/ExprConstant.cpp @@ -4838,16 +4838,10 @@ for (CompoundStmt::const_body_iterator BI = CS->body_begin(), BE = CS->body_end(); - /**/; ++BI) { - if (BI + 1 == BE) { - const Expr *FinalExpr = dyn_cast(*BI); - if (!FinalExpr) { - Info.FFDiag((*BI)->getLocStart(), - diag::note_constexpr_stmt_expr_unsupported); - return false; - } - return this->Visit(FinalExpr); - } + BI != BE; ++BI) { + if (BI + 1 == BE) + if (const Expr *FinalExpr = dyn_cast(*BI)) + return this->Visit(FinalExpr); APValue ReturnValue; StmtResult Result = { ReturnValue, nullptr }; @@ -4863,7 +4857,7 @@ } } - llvm_unreachable("Return from function from the loop above."); + return true; } /// Visit a value which is evaluated, but whose value is ignored. Index: clang/test/SemaCXX/constant-expression-cxx1y.cpp =================================================================== --- clang/test/SemaCXX/constant-expression-cxx1y.cpp +++ clang/test/SemaCXX/constant-expression-cxx1y.cpp @@ -781,9 +781,8 @@ return ({ int n; n; }); // expected-note {{object of type 'int' is not initialized}} } - // FIXME: We should handle the void statement expression case. - constexpr int h() { // expected-error {{never produces a constant}} - ({ if (true) {} }); // expected-note {{not supported}} + constexpr int h() { + ({ if (true) {} }); return 0; } }