[PATCH] c++: Fall through for arrays of T vs T cv [PR104996]#70
Draft
ecatmur wants to merge 4 commits intogcc-mirror:masterfrom
Draft
[PATCH] c++: Fall through for arrays of T vs T cv [PR104996]#70ecatmur wants to merge 4 commits intogcc-mirror:masterfrom
ecatmur wants to merge 4 commits intogcc-mirror:masterfrom
Conversation
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: Ed Catmur <[email protected]> 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.
|
This is a read-only mirror that is not managed by GCC developers. Pull requests in this read-only mirror will be ignored forever. If you wish to contribute to GCC please read: https://gcc.gnu.org/wiki/GettingStarted |
Contributor
|
Committed upstream as 5bde80f |
iains
pushed a commit
to NinaRanns/gcc
that referenced
this pull request
Jan 30, 2025
Fixing an ICE with dependent contract conditions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: Ed Catmur [email protected]
gcc/cp/ChangeLog:
gcc/testsuite/ChangeLog: