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

            Bug ID: 102041
           Summary: Pretty printing of variable templates could be
                    improved
           Product: gcc
           Version: 12.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: ---

This incorrect code:

template<typename T>
concept foo = true;

template<typename T> requires foo<T>
constexpr bool variable = true;

static_assert( variable<int>::value );


Gives this error:

c.C:7:16: error: variable template-id 'variable<int>' in nested-name-specifier
    7 | static_assert( variable<int>::value );
      |                ^~~~~~~~~~~~~
c.C:5:16: note: 'template<class T>  requires  foo<T> constexpr const bool
variable<T>' declared here
    5 | constexpr bool variable = true;
      |                ^~~~~~~~

Showing the "requires  foo<t>" part in the note probably isn't very useful (and
why is there a double space?)

And printing "variable<T>" just seems wrong, it's not a specialization.

Reply via email to