aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-07-20 20:16:53 +0000
committerJeffrey Yasskin <jyasskin@gcc.gnu.org>2010-07-20 20:16:53 +0000
commit0603fe683c89ccf3c1663817c44f0d320a57ba5e (patch)
treed182d7caab0a17dadf100fabc2f21a970aaac53e /gcc/cp
parent1b47fe3fe5a6ddc89896e73a8ec831750bcf69b0 (diff)
downloadgcc-0603fe683c89ccf3c1663817c44f0d320a57ba5e.zip
gcc-0603fe683c89ccf3c1663817c44f0d320a57ba5e.tar.gz
gcc-0603fe683c89ccf3c1663817c44f0d320a57ba5e.tar.bz2
re PR c++/44641 (Generated constructors and destructors get wrong debug location when a typedef uses a forward declaration of the type before the definition)
PR c++/44641 * gcc/cp/pt.c (instantiate_class_template): Propagate the template's location to its instance. * gcc/testsuite/lib/scanasm.exp (dg-function-on-line): Test that a function is defined on the current line. * gcc/testsuite/g++.dg/debug/dwarf2/lineno-simple1.C: New. Line number sanity test. * gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C: New. From-SVN: r162349
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 748f37d..04f9af7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
+
+ PR c++/44641
+ * pt.c (instantiate_class_template): Propagate the template's
+ location to its instance.
+
2010-07-20 Jason Merrill <jason@redhat.com>
PR c++/44967
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b618907..7a33147 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7832,7 +7832,8 @@ instantiate_class_template (tree type)
/* Set the input location to the most specialized template definition.
This is needed if tsubsting causes an error. */
typedecl = TYPE_MAIN_DECL (pattern);
- input_location = DECL_SOURCE_LOCATION (typedecl);
+ input_location = DECL_SOURCE_LOCATION (TYPE_NAME (type)) =
+ DECL_SOURCE_LOCATION (typedecl);
TYPE_HAS_USER_CONSTRUCTOR (type) = TYPE_HAS_USER_CONSTRUCTOR (pattern);
TYPE_HAS_NEW_OPERATOR (type) = TYPE_HAS_NEW_OPERATOR (pattern);