aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/return.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/return.cpp')
-rw-r--r--test/SemaCXX/return.cpp11
1 files changed, 11 insertions, 0 deletions
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}}
+ }
+ };
+}