diff options
-rw-r--r-- | test/Sema/return.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Sema/return.cpp b/test/Sema/return.cpp new file mode 100644 index 0000000000..754bc986b3 --- /dev/null +++ b/test/Sema/return.cpp @@ -0,0 +1,10 @@ +// 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}} + } +}; |