aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index e37ae17..846098e 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -8199,6 +8199,14 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
warning_at (loc, 0, "union cannot be made transparent");
}
+ /* 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);
+
/* If this structure or union completes the type of any previous
variable declaration, lay it out and output its rtl. */
for (x = incomplete_vars; x; x = TREE_CHAIN (x))
@@ -8215,14 +8223,6 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
}
}
- /* 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);
-
/* If we're inside a function proper, i.e. not file-scope and not still
parsing parameters, then arrange for the size of a variable sized type
to be bound now. */