================ @@ -5910,6 +5910,51 @@ static void handleBuiltinAliasAttr(Sema &S, Decl *D, D->addAttr(::new (S.Context) BuiltinAliasAttr(S.Context, AL, Ident)); } +static void handlePreferredTypeAttr(Sema &S, Decl *D, const ParsedAttr &AL) { + if (!AL.hasParsedType()) { + S.Diag(AL.getLoc(), diag::err_attribute_wrong_number_arguments) << AL << 1; + return; + } + + TypeSourceInfo *ParmTSI = nullptr; + QualType QT = S.GetTypeFromParser(AL.getTypeArg(), &ParmTSI); + QT->getAsTagDecl()->setCompleteDefinitionRequired(); ---------------- Endilll wrote:
I've changed this so that `preferred_type` accepts only complete types. We can lift this up later if it's too restrictive. I just don't want to deal with consequences of incomplete types in this PR. https://github.com/llvm/llvm-project/pull/69104 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits