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

c++: tweak for -Wrange-loop-construct [PR116731]

This PR reports that the warning would be better off using a check
for trivially constructible rather than trivially copyable.

LLVM accepted a similar fix:
https://github.com/llvm/llvm-project/issues/47355



	PR c++/116731

gcc/cp/ChangeLog:

	* parser.cc (warn_for_range_copy): Check if TYPE is trivially
	constructible, not copyable.

gcc/testsuite/ChangeLog:

	* g++.dg/warn/Wrange-loop-construct3.C: New test.

Reviewed-by: default avatarJason Merrill <jason@redhat.com>
parent e23e5370
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