aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaTemplate/PR77189.cpp
blob: 1e9cc7984163c06a5381603c3c05d8b573e39100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify %s
// RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify %s
// expected-no-diagnostics

struct false_type {
	static constexpr bool value = false;
};

struct true_type {
	static constexpr bool value = true;
};

template <auto& Value, int>
struct test : false_type {};

template <auto& Value>
struct test<Value, 0> : true_type {};

int main() {
    static constexpr int v = 42;
    static_assert(test<v, 0>::value);
}