[clang] [clang-tools-extra] [clang] Retain unrecognized C++ [[attributes]] in the AST (PR #209224)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 22 11:50:36 PDT 2026
mizvekov wrote:
> So this is a case where we DO recognize the attribute, so it isn't an `UnknownAttr`, right? Cases like this (where we support one form but not another) I think are a touch problematic, in that we have to decide whether we put in `UnknownAttr` (or do we differentiate `IllFormedAttr`?).
Yeah, but the point I am trying to get is that, for an attribute which GCC supports with such a syntax, but Clang doesn't recognize at all, it just won't be possible to get the sensible behavior even with a plugin that somehow parses and tries to instantiate the attribute argument after the fact.
I just didn't go through the whole list of attributes GCC supports for a perfect example.
> BUT if we don't know the atttribute at all, we won't try to instantiate it, which is the obviously sensible thing to do.
Well yeah we can't because we don't know if we are dealing with a type, expression, and what is in scope (ie wether the attribute is 'late parsed' or not).
https://github.com/llvm/llvm-project/pull/209224
More information about the cfe-commits
mailing list