forked from OSchip/llvm-project
PR12625: Cope with classes which have incomplete base or member types:
Don't try to query whether an incomplete type has a trivial copy constructor when determining whether a move constructor should be declared. llvm-svn: 155575
This commit is contained in:
parent
2823f58038
commit
1ad04d95bc
|
@ -8165,7 +8165,7 @@ hasMoveOrIsTriviallyCopyable(Sema &S, QualType Type, bool IsConstructor) {
|
|||
// reference types, are supposed to return false here, but that appears
|
||||
// to be a standard defect.
|
||||
CXXRecordDecl *ClassDecl = Type->getAsCXXRecordDecl();
|
||||
if (!ClassDecl)
|
||||
if (!ClassDecl || !ClassDecl->getDefinition())
|
||||
return true;
|
||||
|
||||
if (Type.isTriviallyCopyableType(S.Context))
|
||||
|
|
|
@ -234,3 +234,10 @@ namespace DR1402 {
|
|||
friend NoMove11 &NoMove11::operator=(NoMove11 &&); // expected-error {{no matching function}}
|
||||
};
|
||||
}
|
||||
|
||||
namespace PR12625 {
|
||||
struct X; // expected-note {{forward decl}}
|
||||
struct Y {
|
||||
X x; // expected-error {{incomplete}}
|
||||
} y = Y();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue