Don't try to query whether an incomplete type has a trivial copy constructor
when determining whether a move constructor should be declared.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155575
91177308-0d34-0410-b5e6-
96231b3b80d8
// 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))
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();
+}