// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify namespace use_after_instantiation { template struct A { static constexpr int &value = R; }; template auto S() { static int s; return A{}; } auto &s = decltype(S())::value; // This is ill-formed, but it should not crash. // FIXME: Right now, it does crash. // expected-no-diagnostics #if 0 template auto T() { static int s; struct A { static constexpr int &value = s; // expected-error {{static}} }; return A{}; } auto &t = decltype(T())::value; #endif }