22 lines · cpp
1// RUN: %clang_cc1 -verify -std=c++20 -fsyntax-only %s2 3// expected-no-diagnostics4 5template <decltype(auto) a>6struct S {7 static constexpr int i = 42;8};9 10template <decltype(auto) a> requires true11struct S<a> {12 static constexpr int i = 0;13};14 15static constexpr int a = 0;16 17void test() {18 static_assert(S<a>::i == 0);19 static_assert(S<(a)>::i == 0);20 static_assert(S<((a))>::i == 0);21}22