[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaTemplate / PR77189.cpp
blob1e9cc7984163c06a5381603c3c05d8b573e39100
1 // RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify %s
3 // expected-no-diagnostics
5 struct false_type {
6 static constexpr bool value = false;
7 };
9 struct true_type {
10 static constexpr bool value = true;
13 template <auto& Value, int>
14 struct test : false_type {};
16 template <auto& Value>
17 struct test<Value, 0> : true_type {};
19 int main() {
20 static constexpr int v = 42;
21 static_assert(test<v, 0>::value);