[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / GH62596.cpp
blobc3fefe693db987b0f0c91cd63075e13b39de180a
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
5 struct foo {
6 static constexpr bool bar() {
7 return true;
10 template<bool B = bar()>
11 static constexpr bool baz() {
12 return B;
15 static_assert(foo::baz(), "");
17 // expected-no-diagnostics