Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4444)

Issue 3233041: [PATCH] Use the definition's source location even for already-instantiated templates (PR c++/46527) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by Jeffrey Yasskin (google)
Modified:
13 years, 4 months ago
Reviewers:
Diego Novillo
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn://gcc.gnu.org/svn/gcc/trunk/
Visibility:
Public.

Description

This patch propagates the source location from a template function's definition to any already-instantiated declarations. It doesn't also copy it to the template_decl, even though that also has the wrong location, because maybe that's supposed to represent the declaration and not the definition. PR c++/46527 * gcc/cp/pt.c (instantiate_decl): Propagate the template's location to its instance. * gcc/testsuite/g++.dg/debug/dwarf2/pr46527.C: New.

Patch Set 1 #

Patch Set 2 : Now with a test #

Total comments: 1

Patch Set 3 : Add a space #

Patch Set 4 : Update the template_decl's location too. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -0 lines) Patch
M gcc/cp/pt.c View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
A gcc/testsuite/g++.dg/debug/dwarf2/pr46527.C View 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 1
Diego Novillo
13 years, 5 months ago (2010-11-20 05:40:09 UTC) #1
As we discussed, it seems reasonable, but I don't know this area very well. 
Jason should give you a definitive answer.

http://codereview.appspot.com/3233041/diff/2001/gcc/cp/pt.c
File gcc/cp/pt.c (right):

http://codereview.appspot.com/3233041/diff/2001/gcc/cp/pt.c#newcode17155
gcc/cp/pt.c:17155: DECL_SOURCE_LOCATION (d) =
DECL_SOURCE_LOCATION(code_pattern);
space before '('.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b