Repository navigation
Alias template CTAD with a constructor trailing requires clause causes segfault #523
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 (in ASan or debug builds) 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(which uses trailing requires clauses) via an alias, e.g.:template<class T, class... Ts> using A = std::tuple<S<T, Ts>...>;.The issue is similar to but distinct from #522.
Reproducing Source Code
Note: this does not crash with an optimized/release build. An ASan or debug build is required.
Command-line Options
cpfe --c++20
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
create_transformed_deduction_guide_for_alias_templatedeclarespack_mappinginside an inner block.ctws_state.alias_parameter_pack_mappingstill points to it when the guide requires-clause is substituted after that block ends, so EDG reads an object after it has been freed.Reproducing (Standard) Configuration(s)
linux-gcc-debug
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