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

            Bug ID: 109715
           Summary: abi_tag attribute is not applied to variable templates
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Given:

template <class T>
[[gnu::abi_tag("ABI")]] inline int value = 0;

int get() {
    return value<int>;
}

gcc mangles the variable value<int> as _Z5valueIiE, instead of
_Z5valueB3ABIIiE. That is, there is no "[abi:ABI]" tag.

clang does propagate this attribute as expected.

gcc does include the abi_tag in the mangling in other template cases (static
data member of a class template, static local variable of a function template,
etc.)

This is a related (but, I'm guessing, much easier) problem to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88061.
  • [Bug c++/109715] New: abi_tag a... barry.revzin at gmail dot com via Gcc-bugs

Reply via email to