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

c++: -Wdangling-reference tweak to unbreak aarch64

My recent -Wdangling-reference change to not warn on std::span-like classes
unfortunately caused a new warning: extending reference_like_class_p also
opens the door to new warnings since we use reference_like_class_p for
checking the return type of the function: either it must be a reference
or a reference_like_class_p.

We can consider even non-templates as std::span-like to get rid of the
warning here.

gcc/cp/ChangeLog:

	* call.cc (reference_like_class_p): Consider even non-templates for
	std::span-like classes.

gcc/ChangeLog:

	* doc/invoke.texi: Update -Wdangling-reference documentation.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wdangling-reference21.C: New test.
parent 44764984
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