Prevent invalid instantiations in erase - #280
Merged
Merged
Conversation
4 tasks
Collaborator
|
LGTM and thanks for this fix. |
wthrowe
force-pushed
the
prevent_instantiations
branch
from
August 7, 2026 18:18
d877b19 to
f4ed8bc
Compare
Contributor
Author
|
Split the script changes into #281, as you've already noticed. |
Collaborator
|
Yup, did you rebased yet ? If yes, gonna merge |
Both gcc and clang attempt to recursively instantiate template arguments to classes passed to the comma operator. If the types are incomplete that seems to be ignored, but definitions that cause substitution failures are errors. I'm not convinced this is actually allowed by the standard, but we have to live with it, and a void cast is a simple workaround. The code for at was changed for consistency, although it was not required since it always tests with a non-present type and so returns type_<no_such_type_>.
wthrowe
force-pushed
the
prevent_instantiations
branch
from
August 7, 2026 18:20
f4ed8bc to
902ad64
Compare
Contributor
Author
|
Done now. |
Collaborator
|
tadam. Thansk for the contribution! |
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.
Both gcc and clang attempt to recursively instantiate template
arguments to classes passed to the comma operator. If the types are
incomplete that seems to be ignored, but definitions that cause
substitution failures are errors. I'm not convinced this is actually
allowed by the standard, but we have to live with it, and a void cast
is a simple workaround.
The code for at was changed for consistency, although it was not
required since it always tests with a non-present type and so returns
type_<no_such_type_>.