mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:46:44 +00:00

Fixes #123524 --- This PR addresses the issue of immediate function expressions not properly evaluated in `constexpr` if conditions. Adding the `ConstantEvaluated` context for expressions in `constexpr` if statements ensures that these expressions are treated as manifestly constant-evaluated and parsed correctly.
13 lines
296 B
C++
13 lines
296 B
C++
// RUN: %clang_cc1 -std=c++20 -verify=cxx20,expected %s
|
|
// RUN: %clang_cc1 -std=c++23 -verify=cxx23,expected %s
|
|
// RUN: %clang_cc1 -std=c++26 -verify=cxx26,expected %s
|
|
|
|
// expected-no-diagnostics
|
|
|
|
namespace GH123524 {
|
|
consteval void fn1() {}
|
|
void fn2() {
|
|
if constexpr (&fn1 != nullptr) { }
|
|
}
|
|
}
|