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

            Bug ID: 92255
           Summary: No "did you mean" hint for specialization of
                    unrecognised variable template
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

namespace X::Y {
  template<typename T> inline constexpr bool foo = false;
}

struct A { };

template<>
constexpr bool X::foo<A> = true;


Compiled with -std=gnu++17 this says:

v.cc:8:22: error: expected initializer before '<' token
    8 | constexpr bool X::foo<A> = true;
      |                      ^


It would be useful to suggest X::Y::foo.

I spent an embarrassingly long time trying to figure out why my specialization
wasn't compiling.

Reply via email to