Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang++] Functions aren't marked immediate-escalating #123405

Closed
katzdm opened this issue Jan 17, 2025 · 1 comment · Fixed by #124404
Closed

[clang++] Functions aren't marked immediate-escalating #123405

katzdm opened this issue Jan 17, 2025 · 1 comment · Fixed by #124404
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party consteval C++20 consteval

Comments

@katzdm
Copy link
Contributor

katzdm commented Jan 17, 2025

https://godbolt.org/z/rvMWrhhYs

It seems that PopExpressionEvaluationContext, which triggers the marking of expressions as immediate-escalating, is performed after the check for whether the function body contains an immediate-escalating expression. Consequently, immediate-escalating functions (i.e., lambdas and constexpr function template specializations) that contain a reference to a consteval function are never marked as immediate.

The RAII object whose teardown invokes PopExpressionEvaluationContext is here, whereas the call that checks whether the function body contains an immediate-escalating expression is here (a few lines later, but within scope of the RAII guard).

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 17, 2025
@frederick-vs-ja frederick-vs-ja added clang:frontend Language frontend issues, e.g. anything involving "Sema" consteval C++20 consteval and removed clang Clang issues not falling into any other category labels Jan 20, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 20, 2025

@llvm/issue-subscribers-clang-frontend

Author: Daniel M. Katz (katzdm)

https://godbolt.org/z/rvMWrhhYs

It seems that PopExpressionEvaluationContext, which triggers the marking of expressions as immediate-escalating, is performed after the check for whether the function body contains an immediate-escalating expression. Consequently, immediate-escalating functions (i.e., lambdas and constexpr function template specializations) that contain a reference to a consteval function are never marked as immediate.

The RAII object whose teardown invokes PopExpressionEvaluationContext is here, whereas the call that checks whether the function body contains an immediate-escalating expression is here (a few lines later, but within scope of the RAII guard).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party consteval C++20 consteval
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants