aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-missing-noreturn.cpp
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-02-16 09:31:36 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-02-16 09:31:36 +0000
commitecb7e5c8afe929ee38155db94de6b084ec32a645 (patch)
tree53010172e19c77ea447bcd89e117cda052ab52e0 /test/SemaCXX/warn-missing-noreturn.cpp
parent5044f5c816adfd5cba17f1adee1a10127296d0bf (diff)
Notes
Diffstat (limited to 'test/SemaCXX/warn-missing-noreturn.cpp')
-rw-r--r--test/SemaCXX/warn-missing-noreturn.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-missing-noreturn.cpp b/test/SemaCXX/warn-missing-noreturn.cpp
new file mode 100644
index 000000000000..32d020f15f3d
--- /dev/null
+++ b/test/SemaCXX/warn-missing-noreturn.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn
+void f() __attribute__((noreturn));
+
+template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
+ f();
+}
+
+template void g<int>(int); // expected-note {{in instantiation of function template specialization 'g<int>' requested here}}
+
+template<typename T> struct A {
+ void g() { // expected-warning {{function could be attribute 'noreturn'}}
+ f();
+ }
+};
+
+template struct A<int>; // expected-note {{in instantiation of member function 'A<int>::g' requested here}}
+
+struct B {
+ template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
+ f();
+ }
+};
+
+template void B::g<int>(int); // expected-note {{in instantiation of function template specialization 'B::g<int>' requested here}}