Jordan Rose | 4eff6b5 | 2012-10-10 17:55:40 +0000 | [diff] [blame] | 1 | #ifdef AS_SYSTEM |
2 | #pragma clang system_header | ||||
3 | |||||
4 | namespace system { | ||||
5 | class A { | ||||
6 | public: | ||||
7 | A() { | ||||
8 | foo(); // no-warning | ||||
9 | } | ||||
10 | |||||
11 | virtual int foo(); | ||||
12 | }; | ||||
13 | } | ||||
14 | |||||
15 | #else | ||||
16 | |||||
17 | namespace header { | ||||
18 | class A { | ||||
19 | public: | ||||
20 | A() { | ||||
21 | foo(); // expected-warning{{Call virtual functions during construction or destruction will never go to a more derived class}} | ||||
22 | } | ||||
23 | |||||
24 | virtual int foo(); | ||||
25 | }; | ||||
26 | } | ||||
27 | |||||
28 | #endif |