c++: Avoid duplicate diagnostic calling unavailable function [PR109177]
authorAlex Coplan <alex.coplan@arm.com>
Wed, 22 Mar 2023 15:20:49 +0000 (15:20 +0000)
committerAlex Coplan <alex.coplan@arm.com>
Wed, 22 Mar 2023 15:20:49 +0000 (15:20 +0000)
commitd3a6f174543816600b1f472997d492088e4e396a
treeac8c60dada910999b3acb7bd444c69b9f8ac54ff
parent0c652ebbf79bd168766097f3ac4c1b3b79d68a43
c++: Avoid duplicate diagnostic calling unavailable function [PR109177]

As the PR shows, we currently emit duplicate diagnostics for calls to
functions marked with __attribute__((unavailable)). This patch fixes
that.

gcc/cp/ChangeLog:

PR c++/109177
* call.cc (build_over_call): Use make_temp_override to suppress
both unavailable and deprecated warnings when calling
build_addr_func.

gcc/testsuite/ChangeLog:

PR c++/109177
* g++.dg/ext/pr109177.C: New test.
gcc/cp/call.cc
gcc/testsuite/g++.dg/ext/pr109177.C [new file with mode: 0644]