Doug's review comments.

llvm-svn: 151173
This commit is contained in:
Sebastian Redl 2012-02-22 17:38:04 +00:00
parent 674c77e555
commit 74b173e5c8
2 changed files with 2 additions and 2 deletions

View File

@ -1878,7 +1878,7 @@ Sema::ActOnCapScopeReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) {
// Delay processing for now. TODO: there are lots of dependent
// types we can conclusively prove aren't void.
} else if (FnRetType->isVoidType()) {
if (RetValExp &&
if (RetValExp && !isa<InitListExpr>(RetValExp) &&
!(getLangOptions().CPlusPlus &&
(RetValExp->isTypeDependent() ||
RetValExp->getType()->isVoidType()))) {

View File

@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Test that a very basic variation of generalized initializer returns (that
// required for libstdc++ 4.5) is supposed in C++98.
// required for libstdc++ 4.5) is supported in C++98.
int test0(int i) {
return { i }; // expected-warning{{generalized initializer lists are a C++11 extension}}