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.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/return.cpp b/test/SemaCXX/return.cpp
index 580f0a7233e2..98dbd51f5806 100644
--- a/test/SemaCXX/return.cpp
+++ b/test/SemaCXX/return.cpp
@@ -102,3 +102,13 @@ namespace return_has_expr {
}
};
}
+
+// rdar://15366494
+// pr17759
+namespace ctor_returns_void {
+ void f() {}
+ struct S {
+ S() { return f(); }; // expected-error {{constructor 'S' must not return void expression}}
+ ~S() { return f(); } // expected-error {{destructor '~S' must not return void expression}}
+ };
+}