// PR c++/97340 // { dg-do compile { target c++14 } } template struct A { template static constexpr const int& var = 0; }; template struct B { static constexpr int x1 = A::template var; static constexpr int y1 = A{}.template var; static constexpr int x2 = A::template var; static constexpr int y2 = A{}.template var; static constexpr int x3 = A::template var; static constexpr int y3 = A{}.template var; }; template struct B;