// RUN: %clang_cc1 -std=c++14 -triple i686-pc-win32 -fms-extensions -DMSABI -verify %s
// RUN: %clang_cc1 -std=c++14 -triple i686-pc-mingw32 -verify %s
// RUN: %clang_cc1 -std=c++14 -triple i686-pc-mingw32 -fms-extensions -verify %s
typedef void ;
typedef void __cdecl ;
// Pointers to free functions
void ; // expected-note 2 {{previous declaration is here}}
void __cdecl ; // expected-note 2 {{previous declaration is here}}
void __stdcall ; // expected-note 2 {{previous declaration is here}}
void __fastcall ; // expected-note 2 {{previous declaration is here}}
void __vectorcall ; // expected-note 2 {{previous declaration is here}}
void __cdecl ;
void __stdcall ; // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
void __fastcall ; // expected-error {{function declared 'fastcall' here was previously declared without calling convention}}
void ;
void __stdcall ; // expected-error {{function declared 'stdcall' here was previously declared 'cdecl'}}
void __fastcall ; // expected-error {{function declared 'fastcall' here was previously declared 'cdecl'}}
void ;
void __cdecl ; // expected-error {{function declared 'cdecl' here was previously declared 'stdcall'}}
void __fastcall ; // expected-error {{function declared 'fastcall' here was previously declared 'stdcall'}}
void __cdecl ; // expected-error {{function declared 'cdecl' here was previously declared 'fastcall'}}
void __stdcall ; // expected-error {{function declared 'stdcall' here was previously declared 'fastcall'}}
void ;
void __cdecl ; // expected-error {{function declared 'cdecl' here was previously declared 'vectorcall'}}
void __stdcall ; // expected-error {{function declared 'stdcall' here was previously declared 'vectorcall'}}
void ;
// Overloaded functions may have different calling conventions
void __fastcall ;
void __cdecl ;
void __thiscall ;
void __cdecl ;
typedef void ;
typedef void __cdecl ;
// Pointers to member functions
;
void __cdecl // expected-error {{function declared 'cdecl' here was previously declared without calling convention}}
void __thiscall
void __cdecl // expected-error {{function declared 'cdecl' here was previously declared without calling convention}}
void __cdecl // expected-error {{function declared 'cdecl' here was previously declared without calling convention}}
void __cdecl
void __stdcall
void
void __thiscall // expected-error {{function declared 'thiscall' here was previously declared 'cdecl'}}
void
void __cdecl // expected-error {{function declared 'cdecl' here was previously declared 'thiscall'}}
void
void __cdecl // expected-error {{function declared 'cdecl' here was previously declared 'vectorcall'}}
void
void __cdecl
void __stdcall // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
void
void __stdcall // expected-error {{function declared 'stdcall' here was previously declared 'cdecl'}}
void __cdecl
void
void __cdecl
void
// Declare a template using a calling convention.
inline int __cdecl
extern int ;
inline int __cdecl
void
;
void
void
// Friend function decls are cdecl by default, not thiscall. Friend method
// decls should always be redeclarations, because the class cannot be
// incomplete.
;
void __stdcall
;
void
void __stdcall // expected-error {{function declared 'stdcall' here was previously declared without calling convention}}
void __stdcall
// Test functions with multiple attributes.
void __stdcall ;
void
// expected-error@+3 {{vectorcall and cdecl attributes are not compatible}}
// expected-error@+2 {{stdcall and cdecl attributes are not compatible}}
// expected-error@+1 {{fastcall and cdecl attributes are not compatible}}
void __cdecl __cdecl __stdcall __cdecl __fastcall __vectorcall ;
void __stdcall
void
void __stdcall
// FIXME: Note the template, not the implicit instantiation.
// expected-error@+2 {{function declared 'cdecl' here was previously declared 'stdcall}}
// expected-note@+1 {{previous declaration is here}}
void __cdecl
;
inline int