https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92062
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Author: mpolacek Date: Mon Oct 21 18:45:45 2019 New Revision: 277266 URL: https://gcc.gnu.org/viewcvs?rev=277266&root=gcc&view=rev Log: PR c++/92062 - ODR-use ignored for static member of class template. has_value_dependent_address wasn't stripping location wrappers so it gave the wrong answer for "&x" in the static_assert. That led us to thinking that the expression isn't instantiation-dependent, and we skipped static initialization of A<0>::x. This patch adds stripping so that has_value_dependent_address gives the same answer as it used to before the location wrappers addition. * pt.c (has_value_dependent_address): Strip location wrappers. * g++.dg/cpp0x/constexpr-odr1.C: New test. * g++.dg/cpp0x/constexpr-odr2.C: New test. Added: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog