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

            Bug ID: 71954
           Summary: template partial specialization for constexpr error
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liweifriends at gmail dot com
  Target Milestone: ---

The code is as follows:

template <typename T> struct Container;

template <typename...T>
struct Str1
{
    template <typename...T1>
    struct Helper1
    {
        constexpr static bool value = true;
    };

    template <typename T2, typename...T3>
    struct Helper1<Container<T2>, T3...>
    {
        constexpr static bool value = false;
    };

    static_assert(Helper1<T...>::value, "Check");
};

template <typename...T>
struct Str2
{
    template <typename...T1>
    static constexpr bool Helper2 = true;

    // ERROR here:
    template <typename T2, typename...T3>
    static constexpr bool Helper2<Container<T2>, T3...> = false;

    static_assert(Helper2<T...>, "Check");
};

When compile with --std=c++14, Str1 is OK but Str2 will cause an Error:
error: explicit template argument list not allowed

Reply via email to