https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92171
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- https://wg21.link/p2280 was accepted as a defect report against all versions of C++. and that makes this code valid. ref.value is now a constexpr even though ref is not one after the paper. (In reply to Marek Polacek from comment #4) > I think this is another example: > > template<int N> struct A { > static constexpr int size() { return N; } > }; > > template<typename T> void f1(T t) { > constexpr int k = t.size(); > } > > template<typename T> void f2(const T &t) { > constexpr int k = t.size(); // error > } > > template<typename T> void f3(const T &t) { > constexpr int k = T::size(); > } > > void g(A<3> a) > { > f1(a); > f2(a); > f3(a); > } This full example is also fully valid after this paper too.