1 #ifdef AS_SYSTEM 2 #pragma clang system_header 3 4 namespace system { 5 class A { 6 public: A()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: A()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 29