Commit 5bde80f4 authored by Ed Catmur's avatar Ed Catmur Committed by Jason Merrill
Browse files

c++: Fall through for arrays of T vs T cv [PR104996]



If two arrays do not have the exact same element type including
qualification, this could be e.g. f(int (&&)[]) vs. f(int const (&)[]),
which can still be distinguished by the lvalue-rvalue tiebreaker.

By tightening this branch (in accordance with the letter of the Standard) we
fall through to the next branch, which tests whether they have different
element type ignoring qualification and returns 0 in that case; thus we only
actually fall through in the T[...] vs. T cv[...] case, eventually
considering the lvalue-rvalue tiebreaker at the end of compare_ics.

Signed-off-by: default avatarEd Catmur <ed@catmur.uk>

	PR c++/104996

gcc/cp/ChangeLog:

	* call.cc (compare_ics): When comparing list-initialization
	sequences, do not return early.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/initlist129.C: New test.
parent 67ded3a1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment