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

            Bug ID: 109177
           Summary: Call to C++ function marked unavailable gets diagnosed
                    twice
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

Reproducer:

$ cat t.cc
void f() __attribute__((unavailable));
void g() { f(); }
$ gcc/xgcc -B gcc -c t.cc
t.cc: In function ‘void g()’:
t.cc:2:13: error: ‘void f()’ is unavailable
    2 | void g() { f(); }
      |            ~^~
t.cc:1:6: note: declared here
    1 | void f() __attribute__((unavailable));
      |      ^
t.cc:2:13: error: ‘void f()’ is unavailable
    2 | void g() { f(); }
      |            ~^~
t.cc:1:6: note: declared here
    1 | void f() __attribute__((unavailable));
      |      ^

This only seems to happen in C++ mode, C diagnoses this once as expected.

Reply via email to