bolt/deps/llvm-18.1.8/clang/test/SemaCXX/GH62596.cpp

18 lines
376 B
C++
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
struct foo {
static constexpr bool bar() {
return true;
}
template<bool B = bar()>
static constexpr bool baz() {
return B;
}
};
static_assert(foo::baz(), "");
// expected-no-diagnostics