forked from OSchip/llvm-project
parent
674c77e555
commit
74b173e5c8
|
@ -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()))) {
|
||||
|
|
|
@ -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}}
|
||||
|
|
Loading…
Reference in New Issue