aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/virtualcall.h
blob: 9f7094dc63e9130360f2db21d9acdbe352f3ed92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifdef AS_SYSTEM
#pragma clang system_header

namespace system {
  class A {
  public:
    A() {
      foo(); // no-warning
    }

    virtual int foo();
  };
}

#else

namespace header {
  class A {
  public:
    A() {
      foo(); // expected-warning{{Call virtual functions during construction or destruction will never go to a more derived class}}
    }

    virtual int foo();
  };
}

#endif