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

            Bug ID: 86310
           Summary: Clang rejects partial specialization with non-type
                    template argument of different type
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
  Target Milestone: ---

The code is as follow:

template<char C1, char C2>
struct X;

template<int C1>
struct X<C1, C1>;

clang++ accepts the code, but g++ rejects it:

code0.c.cpp:5:8: error: template argument '(char)C1' involves template
parameter(s)
 struct X<C1, C1>;
        ^~~~~~~~~
code0.c.cpp:5:8: error: template argument '(char)C1' involves template
parameter(s)

The code comes from a clang report: https://bugs.llvm.org/show_bug.cgi?id=8905

It fixed a similar problem.

Reply via email to