1 | // RUN: %clang_cc1 -triple=x86_64-pc-unknown -fsyntax-only -verify %s |
2 | |
3 | // Non-x86 targets ignore the calling conventions by default (but will warn |
4 | // when one is encountered), so we want to make sure the virtual overrides |
5 | // continue to work. |
6 | namespace PR14339 { |
7 | class A { |
8 | public: |
9 | virtual void __attribute__((thiscall)) f(); // expected-warning {{'thiscall' calling convention ignored for this target}} |
10 | }; |
11 | |
12 | class B : public A { |
13 | public: |
14 | void __attribute__((cdecl)) f(); |
15 | }; |
16 | |
17 | class C : public A { |
18 | public: |
19 | void __attribute__((thiscall)) f(); // expected-warning {{'thiscall' calling convention ignored for this target}} |
20 | }; |
21 | |
22 | class D : public A { |
23 | public: |
24 | void f(); |
25 | }; |
26 | |
27 | class E { |
28 | public: |
29 | virtual void __attribute__((stdcall)) g(); // expected-warning {{'stdcall' calling convention ignored for this target}} |
30 | }; |
31 | |
32 | class F : public E { |
33 | public: |
34 | void g(); |
35 | }; |
36 | } |
37 | |