On 05/03/2016 07:27 AM, Marek Polacek wrote:
On Mon, May 02, 2016 at 01:34:30PM -0400, Jason Merrill wrote:
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?
That, I suppose, is a good idea ;). Thus:
Looks good.
But I don't see a C++ testcase; can the test go into c-c++-common?
Jason