warn-missing-noreturn.cpp revision ca7eaeeed817001dc7cee4852a7e41f0982da1ef
1// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn
2void f() __attribute__((noreturn));
3
4template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
5  f();
6}
7
8template void g<int>(int); // expected-note {{in instantiation of function template specialization 'g<int>' requested here}}
9
10template<typename T> struct A {
11  void g() { // expected-warning {{function could be attribute 'noreturn'}}
12    f();
13  }
14};
15
16template struct A<int>; // expected-note {{in instantiation of member function 'A<int>::g' requested here}}
17
18struct B {
19  template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
20    f();
21  }
22};
23
24template 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.
27struct X {
28  virtual void g() { f(); }
29};
30