OSDN Git Service

Backport r176845.
authorjyasskin <jyasskin@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Jul 2011 22:13:18 +0000 (22:13 +0000)
committerjyasskin <jyasskin@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Jul 2011 22:13:18 +0000 (22:13 +0000)
commit3826401402206eda6ea21349218bfa30d9586648
tree9bf5a3bd491ab3c7b85e68c67b7e555a5dc44fa5
parent23d2bec5f92f8ff13c9175ed30b37fca9b357016
Backport r176845.

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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@176851 138bc75d-0d04-0410-961f-82ee72b054a4
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