// RUN: %clang_cc1 %s -fsyntax-only -verify -Wmissing-noreturn -Wno-unreachable-code

// A destructor may be marked noreturn and should still influence the CFG.
namespace PR6884 {
  struct abort_struct {
    abort_struct() {} // Make this non-POD so the destructor is invoked.
    ~abort_struct() __attribute__((noreturn));
  };

  // FIXME: Should either of these actually warn, since the destructor is
  //  marked noreturn?

  int f() {
    abort_struct();
  } // expected-warning{{control reaches end of non-void function}}

  int f2() {
    abort_struct s;
  } // expected-warning{{control reaches end of non-void function}}
}

// RUN: %clang_cc1 %s -fsyntax-only -verify -Wmissing-noreturn -Wno-unreachable-code

// A destructor may be marked noreturn and should still influence the CFG.
namespace PR6884 {
  struct abort_struct {
    abort_struct() {} // Make this non-POD so the destructor is invoked.
    ~abort_struct() __attribute__((noreturn));
  };

  int f() {
    abort_struct();
  }

  int f2() {
    abort_struct s;
  } // expected-warning{{control reaches end of non-void function}}
}

--- 
+++ 
@@ -7,9 +7,12 @@
     ~abort_struct() __attribute__((noreturn));
   };
 
+  // FIXME: Should either of these actually warn, since the destructor is
+  //  marked noreturn?
+
   int f() {
     abort_struct();
-  }
+  } // expected-warning{{control reaches end of non-void function}}
 
   int f2() {
     abort_struct s;
Update test case, with comment to later investigate the correct behavior.  Now the behavior is at least consistent.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@112335 91177308-0d34-0410-b5e6-96231b3b80d8
