aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
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);