From c49018d9cce52d8c9f34b44865ec3ba8e89a1488 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 12 Jun 2011 15:46:16 +0000 Subject: Vendor import of clang trunk r132879: http://llvm.org/svn/llvm-project/cfe/trunk@132879 --- test/SemaCXX/attr-noreturn.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/SemaCXX/attr-noreturn.cpp') diff --git a/test/SemaCXX/attr-noreturn.cpp b/test/SemaCXX/attr-noreturn.cpp index b7d3999..eaf0d0c 100644 --- a/test/SemaCXX/attr-noreturn.cpp +++ b/test/SemaCXX/attr-noreturn.cpp @@ -1,5 +1,22 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s +// Reachability tests have to come first because they get suppressed +// if any errors have occurred. +namespace test5 { + struct A { + __attribute__((noreturn)) void fail(); + void nofail(); + } a; + + int &test1() { + a.nofail(); + } // expected-warning {{control reaches end of non-void function}} + + int &test2() { + a.fail(); + } +} + // PR5620 void f0() __attribute__((__noreturn__)); void f1(void (*)()); -- cgit v1.1