This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix typedef-name printing (PR c/56980)


On 10/24/14 08:16, Marek Polacek wrote:
Our current C pretty printer output sometimes looks a bit goofy:
"expected âenum F *â but argument is of type âenum F *â".
It's because it always prints "struct"/"union"/"enum" even though
the type is a typedef name.  This patch ought to fix this.
We've got a bunch of reports about this over the years...

The C++ printer can also print "B* {aka A*}", I'll try to learn
c_tree_printer to do something similar as well.

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2014-10-24  Marek Polacek  <polacek@redhat.com>

	PR c/56980
	* c-pretty-print.c (c_pretty_printer::simple_type_specifier): Don't
	print "struct"/"union"/"enum" for typedefed names.

	* gcc.dg/pr56980.c: New test.
OK.
Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]