From: Hans Wennborg Date: Thu, 30 Jun 2011 17:20:18 +0000 (+0000) Subject: Move test/Sema/return.cpp into test/SemaCXX/return.cpp X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=150fee8b2ba3ea6faa12e68cb58adc5e2fc73825;p=clang Move test/Sema/return.cpp into test/SemaCXX/return.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134171 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/return.cpp b/test/Sema/return.cpp deleted file mode 100644 index 754bc986b3..0000000000 --- a/test/Sema/return.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %clang %s -fsyntax-only -Wreturn-type - -struct C { - C() { - return 42; // expected-warning {{constructor 'C' should not return a value}} - } - ~C() { - return 42; // expected-warning {{destructor '~C' should not return a value}} - } -}; diff --git a/test/SemaCXX/return.cpp b/test/SemaCXX/return.cpp index b457f6ace5..2f98a277f6 100644 --- a/test/SemaCXX/return.cpp +++ b/test/SemaCXX/return.cpp @@ -69,3 +69,14 @@ namespace PR10057 { return S() = value; } } + +namespace return_has_expr { + struct S { + S() { + return 42; // expected-error {{constructor 'S' should not return a value}} + } + ~S() { + return 42; // expected-error {{destructor '~S' should not return a value}} + } + }; +}