aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-09-17 22:31:54 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-09-17 22:31:54 +0200
commit591a849566e65174724a0e63f16eefb0538904f8 (patch)
tree2224826c9b77234cf421aa40304993b6bf2a8f51 /gcc/c-decl.c
parent417b30235b1bd5a8af13a21741f7845d4dff3029 (diff)
downloadgcc-591a849566e65174724a0e63f16eefb0538904f8.zip
gcc-591a849566e65174724a0e63f16eefb0538904f8.tar.gz
gcc-591a849566e65174724a0e63f16eefb0538904f8.tar.bz2
c-decl.c (finish_struct): Adjust DECL_SOURCE_LOCATION of TYPE_STUB_DECL.
* c-decl.c (finish_struct): Adjust DECL_SOURCE_LOCATION of TYPE_STUB_DECL. * gcc.dg/debug/dwarf2/struct-loc1.c: New test. From-SVN: r151816
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index ed8863d..c44e35c 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6859,6 +6859,11 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
}
C_TYPE_INCOMPLETE_VARS (TYPE_MAIN_VARIANT (t)) = 0;
+ /* Update type location to the one of the definition, instead of e.g.
+ a forward declaration. */
+ if (TYPE_STUB_DECL (t))
+ DECL_SOURCE_LOCATION (TYPE_STUB_DECL (t)) = loc;
+
/* Finish debugging output for this type. */
rest_of_type_compilation (t, toplevel);