[Bug c++/90031] New: Bogus parse error trying to explicitly specialize a template variable inside class scope

redbeard0531 at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Apr 9 19:51:00 GMT 2019


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

            Bug ID: 90031
           Summary: Bogus parse error trying to explicitly specialize a
                    template variable inside class scope
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redbeard0531 at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/y5GQZd

struct Struct {
    template <typename T, typename = void>
    constexpr static bool use_cond = false;
    template <typename T>
    constexpr static bool use_cond<T, void> = true;
};

<source>:5:27: error: explicit template argument list not allowed
    5 |     constexpr static bool use_cond<T, void> = true;
      |                           ^~~~~~~~~~~~~~~~~


More information about the Gcc-bugs mailing list