xref: /minix3/external/bsd/llvm/dist/clang/test/Analysis/virtualcall.h (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc #ifdef AS_SYSTEM
2*f4a2713aSLionel Sambuc #pragma clang system_header
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc namespace system {
5*f4a2713aSLionel Sambuc   class A {
6*f4a2713aSLionel Sambuc   public:
A()7*f4a2713aSLionel Sambuc     A() {
8*f4a2713aSLionel Sambuc       foo(); // no-warning
9*f4a2713aSLionel Sambuc     }
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc     virtual int foo();
12*f4a2713aSLionel Sambuc   };
13*f4a2713aSLionel Sambuc }
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc #else
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc namespace header {
18*f4a2713aSLionel Sambuc   class A {
19*f4a2713aSLionel Sambuc   public:
A()20*f4a2713aSLionel Sambuc     A() {
21*f4a2713aSLionel Sambuc       foo(); // expected-warning{{Call virtual functions during construction or destruction will never go to a more derived class}}
22*f4a2713aSLionel Sambuc     }
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc     virtual int foo();
25*f4a2713aSLionel Sambuc   };
26*f4a2713aSLionel Sambuc }
27*f4a2713aSLionel Sambuc 
28*f4a2713aSLionel Sambuc #endif
29