Repository navigation
Non-dependent consteval calls in template arg position are considered dependent #352
gwllx
started this conversation in
Issue Triage - Compilation
Replies: 0 comments
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
Non-dependent consteval calls in template arg position are in some cases (e.g. in a requires-clause or default template argument) considered dependent. This causes EDG to require the
typenamekeyword where the other compilers/standard do not. Such cases may lead to unsatisfied constraints or unexpected SFINAE results.Reproducing Source Code
https://godbolt.org/z/oaEad5Yre
The same issue is present when the call is part of a template arg within a default template arg:
https://godbolt.org/z/YTxEz438a
Command-line Options
cpfe --c++20
Type of Issue
[Front End] This code SHOULD compile with these options.
Additional Details
Suggested patch:
non_dependent_consteval_call_as_template_arg.patch
call_did_not_fold_to_constantdoes not account for the case where a non-dependent consteval call was made within aexpr_stack->consteval_need_not_foldcontext and instead transforms the call operand into a template-dependent constant.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