1 // RUN: %clang_cc1 -std=c++2a -x c++ %s -verify
3 namespace use_after_instantiation
{
4 template<int &R
> struct A
{ static constexpr int &value
= R
; };
6 template<typename
= void> auto S() {
11 auto &s
= decltype(S())::value
;
13 // This is ill-formed, but it should not crash.
14 // FIXME: Right now, it does crash.
15 // expected-no-diagnostics
17 template<typename
= void> auto T() {
20 static constexpr int &value
= s
; // expected-error {{static}}
25 auto &t
= decltype(T())::value
;