https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125991

--- Comment #5 from Vineet Gupta <vineetg at gcc dot gnu.org> ---
>> Does this happen with the c++ frontend? Or only the c frontend?

> Does this mean just build the file with cc1plus or use the new style of 
> attribute specifier ?

> For latter it reports issue, despite a local fix which cures the c test above.
>
> ../../build/x86-gcc-1-dwarf-fix/gcc/cc1plus -quiet -O2 -gdwarf pr125991-cpp.C
>    8 | struct msr [[gnu::btf_type_tag ("percpu")]] *msrs_alloc(void);
>      |            ^
> pr125991-cpp.C:8:12: note: an attribute that appertains to a type-specifier 
> is ignored

Above is due to C23/C++11 gnu attr being stricter and not allowing attr slide.
For pointers they want the attr AFTER '*'

Following works fine on trunk with -std=gnu23

```
struct msr * [[gnu::btf_type_tag ("percpu")]] msrs_alloc(void);
```

Reply via email to