Date: Mon, 16 Oct 2023 09:05:03 +0100
> On 16 Oct 2023, at 08:59, Peter Dimov via SG7 <sg7_at_[hidden]> wrote:
>
> Ville Voutilainen wrote:
>> On Mon, 16 Oct 2023 at 10:36, Peter Dimov via SG7 <sg7_at_[hidden]>
>> wrote:
>>> However, the main problem with this is that attributes are currently
>> ignorable,
>>> and must remain so. Some implementations such as Clang don't store
>> unknown
>>> attributes in the AST at all, so it's not possible to get to them via reflection.
>>
>> Surely clang doesn't just toss unknown vendor attributes into the wind?
>
> It totally does.
>
> https://godbolt.org/z/Gh8681o57
>
>> If it does, then perhaps that's a bug to be fixed.
>
> The behavior is by design, apparently.
Well, it seems (to me at least), that the purpose of ignorability is to allow a compiler
to drop stuff that it assigns no meaning to, and can make no action on.
It there are attributes that you want preserved, presumably you intend to act on
them - and therefore probably want to make them non-ignored by the compiler?
Iain
>
>
> --
> SG7 mailing list
> SG7_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg7
>
> Ville Voutilainen wrote:
>> On Mon, 16 Oct 2023 at 10:36, Peter Dimov via SG7 <sg7_at_[hidden]>
>> wrote:
>>> However, the main problem with this is that attributes are currently
>> ignorable,
>>> and must remain so. Some implementations such as Clang don't store
>> unknown
>>> attributes in the AST at all, so it's not possible to get to them via reflection.
>>
>> Surely clang doesn't just toss unknown vendor attributes into the wind?
>
> It totally does.
>
> https://godbolt.org/z/Gh8681o57
>
>> If it does, then perhaps that's a bug to be fixed.
>
> The behavior is by design, apparently.
Well, it seems (to me at least), that the purpose of ignorability is to allow a compiler
to drop stuff that it assigns no meaning to, and can make no action on.
It there are attributes that you want preserved, presumably you intend to act on
them - and therefore probably want to make them non-ignored by the compiler?
Iain
>
>
> --
> SG7 mailing list
> SG7_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg7
Received on 2023-10-16 08:05:06