1 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn
2 void f() __attribute__((noreturn));
3 
4 template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
5   f();
6 }
7 
8 template void g<int>(int); // expected-note {{in instantiation of function template specialization 'g<int>' requested here}}
9 
10 template<typename T> struct A {
11   void g() { // expected-warning {{function could be attribute 'noreturn'}}
12     f();
13   }
14 };
15 
16 template struct A<int>; // expected-note {{in instantiation of member function 'A<int>::g' requested here}}
17 
18 struct B {
19   template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
20     f();
21   }
22 };
23 
24 template void B::g<int>(int); // expected-note {{in instantiation of function template specialization 'B::g<int>' requested here}}
25 
26 // We don't want a warning here.
27 struct X {
28   virtual void g() { f(); }
29 };
30 
31 namespace test1 {
32   bool condition();
33 
34   // We don't want a warning here.
35   void foo() {
36     while (condition()) {}
37   }
38 }
39