[PATCH] D114439: [Annotation] Allow parameter pack expansions and initializer lists in annotate attribute

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 4 06:25:24 PST 2022


erichkeane added inline comments.


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:8153
+
+  bool AttrHasVariadicArg = AL.hasVariadicArg();
+  unsigned AttrNumArgs = AL.getNumArgMembers();
----------------
steffenlarsen wrote:
> erichkeane wrote:
> > This still doesn't work if the VariadicExprArgument isn't last, right?  Do we ensure that is the case in clang-attr-emitter?
> Good point. I don't think there's a check as there are select few attributes that use multiple variadic (`OMPDeclareSimdDecl` and `OMPDeclareVariant` are the only ones, I think.)
> 
> Since I don't think it's safe to check for all, should I make a check similar to the one for type/identifier arguments in attributes marked `AcceptsExprPack`? Would that suffice?
I'm fine rejecting a case that has anything besides expression-arguments(and ones create-able from expression arguments) and limited-to-only-1-must-be-last variadic-expr-list in ClangAttrEmitter.

I believe we discussed that at one point, but I didn't see it here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114439/new/

https://reviews.llvm.org/D114439



More information about the cfe-commits mailing list