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] Better location info for "incomplete type" error msg (PR c/70756)


On 05/02/2016 12:41 PM, Marek Polacek wrote:
On Fri, Apr 29, 2016 at 04:04:13PM -0400, Jason Merrill wrote:
On 04/28/2016 11:59 AM, Marek Polacek wrote:
3) for the C++ FE I used a macro so that I don't have to change all the
     cxx_incomplete_type_error calls now,

How about an inline overload, instead?

I realized the macro was already there, but inline overloads should probably
be preferred these days.  So I used them instead.

It seems sad to discard the location information; could we pass it into
cxx_incomplete_type_diagnostic?

I suppose I can, though it required another inline overload.  I'm not sure
if the patch will make the C++ diagnostics about incomplete types better,
most likely not :/.
+inline void
+cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
+				diagnostic_t diag_kind)
+{
+  cxx_incomplete_type_diagnostic (input_location, value, type, diag_kind);
+}
+

...

-cxx_incomplete_type_diagnostic (const_tree value, const_tree type,
-				diagnostic_t diag_kind)
+cxx_incomplete_type_diagnostic (location_t loc, const_tree value,

-  location_t loc = EXPR_LOC_OR_LOC (value, input_location);

Shouldn't we use EXPR_LOC_OR_LOC in the inline?

Jason


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