Skip to content
Snippets Groups Projects
Commit 22741a09 authored by Marek Polacek's avatar Marek Polacek
Browse files

c++: -Wdangling-reference not suppressed in template [PR109774]

In check_return_expr, we suppress the -Wdangling-reference warning when
we're sure it would be a false positive.  It wasn't working in a
template, though, because the suppress_warning call was never reached.

	PR c++/109774

gcc/cp/ChangeLog:

	* typeck.cc (check_return_expr): In a template, return only after
	suppressing -Wdangling-reference.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wdangling-reference13.C: New test.

(cherry picked from commit f25d2de1)
parent 55088cf3
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment