diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-08 02:05:04 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-08 02:05:04 +0000 |
| commit | 6ac91b4ab4b828fa7d00e6c820d1f802fa103327 (patch) | |
| tree | 903d8b6195abbfea4c3fb6e47c8f4811f8fa3de7 | |
| parent | 3facc189452f9eb0eb6d4876b74cdf8072fa4d40 (diff) | |
| download | ppe42-gcc-6ac91b4ab4b828fa7d00e6c820d1f802fa103327.tar.gz ppe42-gcc-6ac91b4ab4b828fa7d00e6c820d1f802fa103327.zip | |
* tree.h (DECL_SOURCE_FILE): Improve documentation.
(DECL_SOURCE_LINE): Likewise.
* decl.c (duplicate_decls): Update source position information
when a template function is defined.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42993 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 13 | ||||
| -rw-r--r-- | gcc/tree.h | 5 |
4 files changed, 27 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba914495614..6634e5b73de 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-06-07 Mark Mitchell <mark@codesourcery.com> + + * tree.h (DECL_SOURCE_FILE): Improve documentation. + (DECL_SOURCE_LINE): Likewise. + 2001-06-07 Loren J. Rittle <ljrittle@acm.org> * config/alpha/elf.h (MAKE_DECL_ONE_ONLY): Copy definition diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8be3d79c91d..fb986e5be3c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2001-06-07 Mark Mitchell <mark@codesourcery.com> + + * decl.c (duplicate_decls): Update source position information + when a template function is defined. + 2001-06-07 Phil Edwards <pme@sources.redhat.com> * lang-specs.h: Move -D_GNU_SOURCE to config/linux.h. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 22fb9ef7974..5acf6220649 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3499,6 +3499,19 @@ duplicate_decls (newdecl, olddecl) = chainon (DECL_TEMPLATE_SPECIALIZATIONS (olddecl), DECL_TEMPLATE_SPECIALIZATIONS (newdecl)); + /* If the new declaration is a definition, update the file and + line information on the declaration. */ + if (DECL_INITIAL (DECL_RESULT (olddecl)) == NULL_TREE + && DECL_INITIAL (DECL_RESULT (newdecl)) != NULL_TREE) + { + DECL_SOURCE_LINE (olddecl) + = DECL_SOURCE_LINE (DECL_RESULT (olddecl)) + = DECL_SOURCE_LINE (newdecl); + DECL_SOURCE_FILE (olddecl) + = DECL_SOURCE_FILE (DECL_RESULT (olddecl)) + = DECL_SOURCE_FILE (newdecl); + } + return 1; } diff --git a/gcc/tree.h b/gcc/tree.h index 8634acb6617..8f29728849b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1347,7 +1347,10 @@ struct tree_type /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which if nonzero, indicates that the field occupies the type. */ #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->decl.initial) -/* These two fields describe where in the source code the declaration was. */ +/* These two fields describe where in the source code the declaration + was. If the declaration appears in several places (as for a C + function that is declared first and then defined later), this + information should refer to the definition. */ #define DECL_SOURCE_FILE(NODE) (DECL_CHECK (NODE)->decl.filename) #define DECL_SOURCE_LINE(NODE) (DECL_CHECK (NODE)->decl.linenum) /* Holds the size of the datum, in bits, as a tree expression. |

