PR c++/8570 line number in error message is badly placed with illegal template friend declaration

Manuel López-Ibáñez lopezibanez@gmail.com
Mon Nov 12 00:03:00 GMT 2007


:ADDPATCH c++:

The problem here is that input_location points to the start of the
declaration of the class instead of the point where the friend
template is being declared.

bootstrapped and regression tested with --enable-languages=all on
x86_64-unknown-linux-gnu

OK to commit?

2007-11-11  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

cp/
  * pt.c (redeclare_class_template): Update error message. Use a note
to show the previous declaration.
  (tsubst_friend_class): Use the location of the friend template as
the input location before calling redeclare_class_template.

testsuite/
  * g++.old-deja/g++.ns/template13.C: Update expected output.
  * g++.old-deja/g++.pt/friend23.C: Likewise.
  * g++.dg/warn/pr8570.C: New.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-pr8570.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20071112/d5aec4c0/attachment.ksh>


More information about the Gcc-patches mailing list