Skip to content

Prevent invalid instantiations in erase - #280

Merged
jfalcou merged 1 commit into
edouarda:masterfrom
wthrowe:prevent_instantiations
Aug 7, 2026
Merged

Prevent invalid instantiations in erase#280
jfalcou merged 1 commit into
edouarda:masterfrom
wthrowe:prevent_instantiations

Conversation

@wthrowe

@wthrowe wthrowe commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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_>.

@jfalcou

jfalcou commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

LGTM and thanks for this fix.
Without sounding too demanding, would mind split this PR so we have one for the fix and one for the infrastructure changes (cmake, script et ) ?
I will merge them asap after that

@wthrowe
wthrowe force-pushed the prevent_instantiations branch from d877b19 to f4ed8bc Compare August 7, 2026 18:18
@wthrowe

wthrowe commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Split the script changes into #281, as you've already noticed.

@jfalcou

jfalcou commented Aug 7, 2026

Copy link
Copy Markdown
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
wthrowe force-pushed the prevent_instantiations branch from f4ed8bc to 902ad64 Compare August 7, 2026 18:20
@wthrowe

wthrowe commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Done now.

@jfalcou
jfalcou merged commit 4fe4793 into edouarda:master Aug 7, 2026
4 checks passed
@jfalcou

jfalcou commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

tadam. Thansk for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants