1 // RUN: %clang_cc1 -std=c++11 -fms-extensions -fms-compatibility -fsyntax-only -triple=i386-pc-win32 -verify %s
5 #pragma vtordisp(pop) // expected-warning {{#pragma vtordisp(pop, ...) failed: stack empty}}
6 #pragma vtordisp(push, 0)
7 #pragma vtordisp(push, 1)
8 #pragma vtordisp(push, 2)
9 struct B
: virtual A
{ int b
; };
13 #pragma vtordisp(pop) // expected-warning {{#pragma vtordisp(pop, ...) failed: stack empty}}
15 #pragma vtordisp(push, 3) // expected-warning {{expected integer between 0 and 2 inclusive in '#pragma vtordisp' - ignored}}
19 #pragma vtordisp(push, ONE)
21 #pragma vtordisp(push, TWO)
25 #pragma vtordisp(pop) // stack should NOT be affected by reset.
26 // Now stack contains '1'.
28 #pragma vtordisp( // expected-warning {{unknown action for '#pragma vtordisp' - ignored}}
29 #pragma vtordisp(asdf) // expected-warning {{unknown action for '#pragma vtordisp' - ignored}}
30 #pragma vtordisp(,) // expected-warning {{unknown action for '#pragma vtordisp' - ignored}}
31 #pragma vtordisp // expected-warning {{missing '(' after '#pragma vtordisp' - ignoring}}
32 #pragma vtordisp(3) // expected-warning {{expected integer between 0 and 2 inclusive in '#pragma vtordisp' - ignored}}
33 #pragma vtordisp(), stuff // expected-warning {{extra tokens}}
37 struct D
: virtual A
{
46 #pragma vtordisp(pop) // After this stack should be empty.
47 #pragma vtordisp(pop) // expected-warning {{#pragma vtordisp(pop, ...) failed: stack empty}}
50 #pragma vtordisp(push, 2)
51 struct F
: virtual E
{
57 #pragma vtordisp(pop) // OK because of local vtordisp(2) in g().
61 #pragma vtordisp(push, 2) // Method-local pragma - stack will be restored on exit.
65 // Stack is restored on exit from G::f(), nothing to pop.
66 #pragma vtordisp(pop) // expected-warning {{#pragma vtordisp(pop, ...) failed: stack empty}}
69 // FIXME: Our implementation based on token insertion makes it impossible for
70 // the pragma to appear everywhere we should support it.