Repository navigation
Alias template CTAD with a member template call in constructor noexcept segfaults #522
Closed
gwllx
started this conversation in
Issue Triage - Compilation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Summary
EDG segfaults on valid C++20 code that uses CTAD through an alias template when:
The construct causing this crash was found when compiling a project using the libstdc++
std::tuple: libstdc++-v3/include/std/tuple#L984.Reproducing Source Code
https://godbolt.org/z/P8zh8bEf9
Command-line Options
cpfe --c++20
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
make_operand_for_rescanned_identifiersubstitutes the explicit template arguments of a dependent member template-id, then passes the substituted list toscan_identifier, which substitutes it again. When an alias template deduction guide is created, the substituted arguments refer to the new template parameter list, which has the same depth as the guide's list. The second substitution then indexes past the end of the guide's list, and EDG segfaults inget_template_arg_by_list_pos.Reproducing (Standard) Configuration(s)
linux-gcc-release
Reproducing (Non-standard) Configuration
No response
I acknowledge that:
LICENSE.txtfile in my.zipor.tar.gzupload. If I included aLICENSE.txtfile, any tests created using the reproducing source code will be governed by the terms of the license I provided instead.All reactions