From: ian Date: Tue, 15 Jan 2019 23:54:37 +0000 (+0000) Subject: gcc/: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb94628769b7ac5b9315ac26e2e441986c49ae7a;p=thirdparty%2Fgcc.git gcc/: * godump.c (go_output_typedef): When outputting a typedef, refer to the underlying type by its name and not its structure. gcc/testsuite: * gcc.misc-tests/godump-1.c: Add test case for typedef before struct. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267958 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e1ae217c03c2..153a5ab0951c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-01-15 Nikhil Benesch + + * godump.c (go_output_typedef): When outputting a typedef, refer + to the underlying type by its name and not its structure. + 2019-01-15 David Malcolm PR c++/88795 diff --git a/gcc/godump.c b/gcc/godump.c index 17390b8be624..617a96486cd0 100644 --- a/gcc/godump.c +++ b/gcc/godump.c @@ -1181,7 +1181,7 @@ go_output_typedef (struct godump_container *container, tree decl) return; *slot = CONST_CAST (void *, (const void *) type); - if (!go_format_type (container, TREE_TYPE (decl), false, false, NULL, + if (!go_format_type (container, TREE_TYPE (decl), true, false, NULL, false)) { fprintf (go_dump_file, "// "); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d226aa54af6f..f032b48a37e7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-01-15 Nikhil Benesch + + * gcc.misc-tests/godump-1.c: Add test case for typedef before + struct. + 2019-01-15 David Malcolm PR c++/88795 diff --git a/gcc/testsuite/gcc.misc-tests/godump-1.c b/gcc/testsuite/gcc.misc-tests/godump-1.c index ee984e5b574f..f97bbecc9bc8 100644 --- a/gcc/testsuite/gcc.misc-tests/godump-1.c +++ b/gcc/testsuite/gcc.misc-tests/godump-1.c @@ -468,6 +468,11 @@ struct { double d; uint8_t : 0; } sd_not_equiv; typedef struct s_undef_t s_undef_t2; +typedef struct s_fwd *s_fwd_p; +/* { dg-final { scan-file godump-1.out "(?n)^type _s_fwd_p \\*_s_fwd$" } } */ + +struct s_fwd { }; +/* { dg-final { scan-file godump-1.out "(?n)^type _s_fwd struct \{ \}$" } } */ /*** nested structs ***/ typedef struct { struct { uint8_t ca[3]; } s; uint32_t i; } tsn;