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);