[cfe-commits] r134163 - /cfe/trunk/test/Sema/return.cpp

Hans Wennborg hans at hanshq.net
Thu Jun 30 08:48:23 PDT 2011


Author: hans
Date: Thu Jun 30 10:48:23 2011
New Revision: 134163

URL: http://llvm.org/viewvc/llvm-project?rev=134163&view=rev
Log:
Test for errors for returning a value from a ctor or dtor.

This fell out when Chandler landed the patch in r134138.

Added:
    cfe/trunk/test/Sema/return.cpp   (with props)

Added: cfe/trunk/test/Sema/return.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.cpp?rev=134163&view=auto
==============================================================================
--- cfe/trunk/test/Sema/return.cpp (added)
+++ cfe/trunk/test/Sema/return.cpp Thu Jun 30 10:48:23 2011
@@ -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}}
+  }
+};

Propchange: cfe/trunk/test/Sema/return.cpp
------------------------------------------------------------------------------
    svn:eol-style = LF





More information about the cfe-commits mailing list