================
@@ -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();
----------------
AaronBallman wrote:
I think we want a different approach here. If we decide to do non-integral/enum
types right now, I think we want to call `Sema::RequireCompleteType()` on the
given type. This will then diagnose uses of types like `void` or `int[]` as
well as forward declarations. Losing forward declarations is a bit sad (because
it could be completed later), but I think we can relax this restriction in the
future as we find uses.
https://github.com/llvm/llvm-project/pull/69104
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits