+++ /dev/null
-// 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}}
- }
-};
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}}
+ }
+ };
+}