From de7a9c2415205846dc28077d0d6ca4fa9b222fc8 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 30 Jun 2011 17:20:18 +0000 Subject: [PATCH] Move test/Sema/return.cpp into test/SemaCXX/return.cpp llvm-svn: 134171 --- clang/test/Sema/return.cpp | 10 ---------- clang/test/SemaCXX/return.cpp | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 clang/test/Sema/return.cpp diff --git a/clang/test/Sema/return.cpp b/clang/test/Sema/return.cpp deleted file mode 100644 index 754bc986b366..000000000000 --- a/clang/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/clang/test/SemaCXX/return.cpp b/clang/test/SemaCXX/return.cpp index b457f6ace55a..2f98a277f638 100644 --- a/clang/test/SemaCXX/return.cpp +++ b/clang/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}} + } + }; +}