Remember the location of a variable template-id.
authorJason Merrill <jason@redhat.com>
Wed, 27 Nov 2019 03:14:33 +0000 (22:14 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 27 Nov 2019 03:14:33 +0000 (22:14 -0500)
commit6821245b3fd9e392ca56dfab4a4921a59ffa234b
treefbf6664ddf8b75e5751be33ff9a1987da6c3854e
parent88b34a4811a0a5237138bbd6700202c2f3569c7d
Remember the location of a variable template-id.

I noticed that tsubst of a TEMPLATE_ID_EXPR was losing the location
information from its EXPR_LOCATION.  Then I noticed that
cxx_eval_constant_expression was also throwing away location information for
variable references.

* pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
location of a variable template-id.
* constexpr.c (cxx_eval_constant_expression): Get expr location
before stripping location wrappers.
(non_const_var_error): Take location argument.

From-SVN: r278755
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/pt.c
gcc/testsuite/g++.dg/concepts/pr67595.C
gcc/testsuite/g++.dg/cpp1y/var-templ64.C [new file with mode: 0644]