summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2012-02-22 17:38:04 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2012-02-22 17:38:04 +0000
commit74b173e5c8c25800dbdbfb50e4acabaf1861e491 (patch)
tree0996366d49a0de35846d3677182944a9e172c940
parent674c77e5552ebb1bd3ae9ceaa3c6fd5e248ffea9 (diff)
downloadbcm5719-llvm-74b173e5c8c25800dbdbfb50e4acabaf1861e491.tar.gz
bcm5719-llvm-74b173e5c8c25800dbdbfb50e4acabaf1861e491.zip
Doug's review comments.
llvm-svn: 151173
-rw-r--r--clang/lib/Sema/SemaStmt.cpp2
-rw-r--r--clang/test/SemaCXX/cxx0x-return-init-list.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index a2dda0201ba..cad6d674bf8 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -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()))) {
diff --git a/clang/test/SemaCXX/cxx0x-return-init-list.cpp b/clang/test/SemaCXX/cxx0x-return-init-list.cpp
index b2cb3d37ce7..da83271c4d7 100644
--- a/clang/test/SemaCXX/cxx0x-return-init-list.cpp
+++ b/clang/test/SemaCXX/cxx0x-return-init-list.cpp
@@ -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}}
OpenPOWER on IntegriCloud