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

            Bug ID: 93503
           Summary: Duplicated warning on pure virtual implicit template
                    in C++2a
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arthur.j.odwyer at gmail dot com
  Target Milestone: ---

// https://godbolt.org/z/FCqkWh
template<class> concept A = true;
struct S {
    virtual int foo(A auto) = 0;
};

g++ test.cc -std=c++2a

test.cc:3:31: error: templates may not be 'virtual'
    3 |     virtual int foo(A auto) = 0;
      |                               ^
test.cc:3:17: error: implicit templates may not be 'virtual'
    3 |     virtual int foo(A auto) = 0;
      |                 ^~~

It is just a tiny bit suboptimal that the same warning appears twice.
The issue seems to be something about the "=0"; a virtual function with
";" or "{}" or "=delete" does not give the same duplicated warning.

Reply via email to