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

            Bug ID: 69515
           Summary: partial specialization of variable templates is broken
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

Reduced from http://stackoverflow.com/q/35027853/2756719:

struct A { A(int = 0); };

template<class...> class meow;

template<typename T> A foo;
template<typename... Ts> A foo<meow<Ts...>> = 1;

auto&& a = foo<meow<int>>;
auto&& b = foo<meow<int, int>>;

Output:

/tmp/ccpeDea7.s: Assembler messages:
/tmp/ccpeDea7.s:24: Error: symbol `foo' is already defined

Additionally, attempting to explicitly instantiate 'foo' using the partial
specialization causes a bogus error:

template A foo<int>;  // OK
template A foo<meow<int>>; // Error

prog.cc:11:12: error: 'foo' is not a static data member of a class template
 template A foo<meow<int>>;
            ^~~~~~~~~~~~~~

Reply via email to