On 10/03/2011 04:08 PM, Dodji Seketeli wrote:
Jason Merrill<ja...@redhat.com>  writes:
-finish_declspecs (struct c_declspecs *specs)
+finish_declspecs (struct c_declspecs *specs,
+                 location_t where)

I'm not sure the beginning of the declspecs is a better place for
these diagnostics than the beginning of the declarator.

To fix the particular example of PR 7263 (and the example
gcc/testsuite/gcc.dg/cpp/syshdr3.c that I added to that particular
patch) where the declspec is what is defined in the system header, and
the declaration (declspec + declarator) gets assembled in the source, we
want pedwarn[1] (really diagnostic_report_diagnostic) to detect that the
declspec is spelled in a system header.  So we want pedwarn to be passed
the location of a declspec.

So then this change would make

_Complex c;

OK, but not

static _Complex c;

because the first declspec is not from a macro, right?

I believe you noted this at some point and
agreed with me that ideally each declspec should come with its location
but that's work for another occasion.

If I'm right about the above example, I think I'd rather hold off this declspecs change until that time.

Jason

Reply via email to