brintos

brintos / llvm-project-archived public Read only

0
0
Text · 466 B · 1e9cc79 Raw
23 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++17 -verify %s2// RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify %s3// expected-no-diagnostics4 5struct false_type {6	static constexpr bool value = false;7};8 9struct true_type {10	static constexpr bool value = true;11};12 13template <auto& Value, int>14struct test : false_type {};15 16template <auto& Value>17struct test<Value, 0> : true_type {};18 19int main() {20    static constexpr int v = 42;21    static_assert(test<v, 0>::value);22}23