http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55275

             Bug #: 55275
           Summary: abi_tag attribute doesn't work on explicit
                    specializations of class templates
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: r...@gcc.gnu.org
                CC: ja...@gcc.gnu.org


This doesn't compile:

template<typename T>
struct __attribute ((abi_tag("cxx11"))) Foo
{
  int f();
};

template<>
struct
__attribute ((abi_tag("cxx11")))
Foo<int>
{
  int f();
};

int main()
{
  Foo<int> f;
  f.f();
}

abi.cc:10:1: error: redeclaration of ‘struct Foo<int>’ adds abi tag "cxx11"
 Foo<int>
 ^
abi.cc:2:41: note: previous declaration here
 struct __attribute ((abi_tag("cxx11"))) Foo
                                         ^

If I remove the attribute from the specialization then it compiles but the name
of the specialization doesn't include the abi_tag:

                 U _ZN3FooIiE1fEv

I want to use this with std::future which has explicit specializations.

Reply via email to