diff options
author | Marek Polacek <polacek@redhat.com> | 2024-01-19 13:59:41 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2024-01-23 16:35:31 -0500 |
commit | 9010fdba68063beccfbab0aa9ec8739f232ca2f4 (patch) | |
tree | 28a49f0ba5a0ff17670eeb1a57173309e5f6997a /gcc/cgraph.cc | |
parent | ed4c7893de2cbae0a07bb4984e408d57e6db06f3 (diff) | |
download | gcc-9010fdba68063beccfbab0aa9ec8739f232ca2f4.zip gcc-9010fdba68063beccfbab0aa9ec8739f232ca2f4.tar.gz gcc-9010fdba68063beccfbab0aa9ec8739f232ca2f4.tar.bz2 |
c++: -Wdangling-reference and lambda false warning [PR109640]
-Wdangling-reference checks if a function receives a temporary as its
argument, and only warns if any of the arguments was a temporary. But
we should not warn when the temporary represents a lambda or we generate
false positives as in the attached testcases.
PR c++/113256
PR c++/111607
PR c++/109640
gcc/cp/ChangeLog:
* call.cc (do_warn_dangling_reference): Don't warn if the temporary
is of lambda type.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wdangling-reference14.C: New test.
* g++.dg/warn/Wdangling-reference15.C: New test.
* g++.dg/warn/Wdangling-reference16.C: New test.
Diffstat (limited to 'gcc/cgraph.cc')
0 files changed, 0 insertions, 0 deletions