// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
;
;
// A defaulted copy constructor for a class X is defined as deleted if X has:
// -- a variant member with a non-trivial corresponding constructor
;
DeletedNTVariant DVa;
DeletedNTVariant ; // expected-error{{call to implicitly-deleted copy constructor}}
;
DeletedNTVariant2 DV2a;
DeletedNTVariant2 ; // expected-error{{call to implicitly-deleted copy constructor}}
// -- a non-static data member of class type M (or array thereof) that cannot be
// copied because overload resolution results in an ambiguity or a function
// that is deleted or inaccessible
;
;
HasNoAccess HNAa;
HasNoAccess ; // expected-error{{call to implicitly-deleted copy constructor}}
;
HasAccess HAa;
HasAccess ;
;
;
;
IsAmbiguous IAa;
IsAmbiguous ; // expected-error{{call to implicitly-deleted copy constructor}}
;
Deleted Da;
Deleted ; // expected-error{{call to implicitly-deleted copy constructor}}
// It's implied (but not stated) that this also applies in the case where
// overload resolution would fail.
vm1, ; // expected-error {{deleted}}
// -- a direct or virtual base class B that cannot be copied because overload
// resolution results in an ambiguity or a function that is deleted or
// inaccessible
;
extern AmbiguousCopyBase ACBa;
AmbiguousCopyBase ; // expected-error {{deleted copy constructor}}
; // expected-note {{copy constructor of 'DeletedCopyBase' is implicitly deleted because base class 'AmbiguousCopyBase' has a deleted copy constructor}}
extern DeletedCopyBase DCBa;
DeletedCopyBase ; // expected-error {{deleted copy constructor}}
; // expected-note {{copy constructor of 'InaccessibleCopyBase' is implicitly deleted because base class 'NoAccess' has an inaccessible copy constructor}}
extern InaccessibleCopyBase ICBa;
InaccessibleCopyBase ; // expected-error {{deleted copy constructor}}
// -- any direct or virtual base class or non-static data member of a type with
// a destructor that is deleted or inaccessible
;
;
HasNoAccessDtor HNADa;
HasNoAccessDtor ; // expected-error{{call to implicitly-deleted copy constructor}}
;
HasAccessDtor HADa;
HasAccessDtor ;
;
extern HasNoAccessDtorBase HNADBa;
HasNoAccessDtorBase ; // expected-error{{implicitly-deleted copy constructor}}
// -- a non-static data member of rvalue reference type
int some_int;
;
RValue RVa;
RValue ; // expected-error{{call to implicitly-deleted copy constructor}}
// FIXME: The error on the class-name is attached to the location of the
// constructor. This is not especially clear.
;
RValueTmp RVTa; // expected-note {{implicit default constructor for 'RValueTmp' first required here}}
RValueTmp ; // expected-error{{call to implicitly-deleted copy constructor}}