1 // RUN: %clang_cc1 -triple x86_64-windows-msvc -fexceptions -fcxx-exceptions -fms-extensions -verify %s -std=c++11
3 // The MS ABI has a few ways to generate constructor closures, which require
4 // instantiating and checking the semantics of default arguments. Make sure we
8 struct DependentDefaultCtorArg
{
9 // expected-error@+1 {{type 'int' cannot be used prior to '::' because it has no members}}
10 DependentDefaultCtorArg(int n
= T::error
);
13 __declspec(dllexport
) // expected-note {{due to 'ExportDefaultCtorClosure' being dllexported}}
14 ExportDefaultCtorClosure
// expected-note {{in instantiation of default function argument expression for 'DependentDefaultCtorArg<int>' required here}} expected-note {{implicit default constructor for 'ExportDefaultCtorClosure' first required here}}
15 : DependentDefaultCtorArg
<int>
19 struct DependentDefaultCopyArg
{
20 DependentDefaultCopyArg() {}
21 // expected-error@+1 {{type 'int' cannot be used prior to '::' because it has no members}}
22 DependentDefaultCopyArg(const DependentDefaultCopyArg
&o
, int n
= T::member
) {}
28 void UseDependentArg() { throw DependentDefaultCopyArg
<HasMember
>(); }
30 void ErrorInDependentArg() {
31 throw DependentDefaultCopyArg
<int>(); // expected-note {{required here}}
39 Default(const Default
&o
, int d
= (HasCleanup(), 42));
42 void f(const Default
&d
) {