Propagate the source location of a template's function_decl to the template_decl...
authorJeffrey Yasskin <jyasskin@google.com>
Wed, 27 Jul 2011 18:38:48 +0000 (18:38 +0000)
committerJeffrey Yasskin <jyasskin@gcc.gnu.org>
Wed, 27 Jul 2011 18:38:48 +0000 (18:38 +0000)
commitce77c22f1bf5674d60710fba3cf8c43d502db01b
tree0046d7d004c0b89fc7974e8ca5f38cc5ebe79a08
parentf22cfb2e4ef3c8749a4814ebd5d0b39173b05b18
Propagate the source location of a template's function_decl to the template_decl built out of it.

Propagate the source location of a template's function_decl to the
template_decl built out of it.  Without this, specializations
generated before the template was defined get the location of the
closing ')' instead of the location of the template's name, which can
produce inconsistent locations between translation units, which makes
gold's ODR checker unhappy.

* gcc/cp/pt.c (build_template_decl): Copy the function_decl's source
location to the new template_decl.
* gcc/testsuite/g++.old-deja/g++.pt/crash60.C: Updated.
* libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Updated.

From-SVN: r176845
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.pt/crash60.C
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc