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

            Bug ID: 106880
           Summary: [12/13 Regression] "error: use of deleted function"
                    printed twice
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
                CC: ppalka at gcc dot gnu.org
  Target Milestone: ---

Since r12-295 we print the error twice for this code:

namespace x {
void foo() = delete;
}

template<typename T>
void f(T t)
{
  using x::foo;
  foo(t);
}

void g()
{
  f(1);
}


dup.C: In instantiation of 'void f(T) [with T = int]':
dup.C:14:4:   required from here
dup.C:9:6: error: use of deleted function 'void x::foo()'
    9 |   foo(t);
      |   ~~~^~~
dup.C:2:6: note: declared here
    2 | void foo() = delete;
      |      ^~~
dup.C:9:6: error: use of deleted function 'void x::foo()'
    9 |   foo(t);
      |   ~~~^~~
dup.C:2:6: note: declared here
    2 | void foo() = delete;
      |      ^~~

Reply via email to