From: Sebastian Redl Date: Wed, 22 Feb 2012 17:38:04 +0000 (+0000) Subject: Doug's review comments. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b38a0f98e4420dae1bd3e13959bc207c97a9e98;p=clang Doug's review comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151173 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index a2dda0201b..cad6d674bf 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/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(RetValExp) && !(getLangOptions().CPlusPlus && (RetValExp->isTypeDependent() || RetValExp->getType()->isVoidType()))) { diff --git a/test/SemaCXX/cxx0x-return-init-list.cpp b/test/SemaCXX/cxx0x-return-init-list.cpp index b2cb3d37ce..da83271c4d 100644 --- a/test/SemaCXX/cxx0x-return-init-list.cpp +++ b/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}}