1 // RUN: %clang_cc1 -fsyntax-only -fms-extensions -verify -triple i686-pc-win32 %s
2 // RUN: %clang_cc1 -fsyntax-only -fms-extensions -verify -triple x86_64-pc-win32 %s
3 // RUN: %clang_cc1 -x c++ -fsyntax-only -fms-extensions -verify -triple i686-pc-win32 %s
4 // RUN: %clang_cc1 -x c++ -DEXTERN_C='extern "C"' -fsyntax-only -fms-extensions -verify -triple i686-pc-win32 %s
8 #if defined(__cplusplus)
10 // expected-no-diagnostics
15 // expected-note-re@+2 1+ {{forward declaration of '{{(struct )?}}Foo'}}
19 EXTERN_C
void __stdcall
fwd_std(struct Foo p
);
20 #if !defined(EXPECT_NODIAG) && defined(_M_IX86)
21 // expected-error@+2 {{parameter 'p' must have a complete type to use function 'fwd_std' with the stdcall calling convention}}
23 void (__stdcall
*fp_fwd_std
)(struct Foo
) = &fwd_std
;
25 EXTERN_C
void __fastcall
fwd_fast(struct Foo p
);
26 #if !defined(EXPECT_NODIAG) && defined(_M_IX86)
27 // expected-error@+2 {{parameter 'p' must have a complete type to use function 'fwd_fast' with the fastcall calling convention}}
29 void (__fastcall
*fp_fwd_fast
)(struct Foo
) = &fwd_fast
;
31 EXTERN_C
void __vectorcall
fwd_vector(struct Foo p
);
32 #if !defined(EXPECT_NODIAG)
33 // expected-error@+2 {{parameter 'p' must have a complete type to use function 'fwd_vector' with the vectorcall calling convention}}
35 void (__vectorcall
*fp_fwd_vector
)(struct Foo
) = &fwd_vector
;
37 #if defined(__cplusplus)
38 template <typename T
> struct TemplateWrapper
{
40 // expected-error@+2 {{field has incomplete type 'Foo'}}
45 EXTERN_C
void __vectorcall
tpl_ok(TemplateWrapper
<int> p
);
46 void(__vectorcall
*fp_tpl_ok
)(TemplateWrapper
<int>) = &tpl_ok
;
48 EXTERN_C
void __vectorcall
tpl_fast(TemplateWrapper
<Foo
> p
);
50 // expected-note@+2 {{requested here}}
52 void(__vectorcall
*fp_tpl_fast
)(TemplateWrapper
<Foo
>) = &tpl_fast
;