From 5b38a0f98e4420dae1bd3e13959bc207c97a9e98 Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Wed, 22 Feb 2012 17:38:04 +0000 Subject: [PATCH] Doug's review comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151173 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaStmt.cpp | 2 +- test/SemaCXX/cxx0x-return-init-list.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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}} -- 2.40.0