Hi,

On 11/10/19 15:37, Marek Polacek wrote:

Index: cp/decl.c
===================================================================
--- cp/decl.c   (revision 276845)
+++ cp/decl.c   (working copy)
@@ -4992,7 +4992,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs,
if (TREE_CODE (declared_type) != UNION_TYPE
          && !in_system_header_at (input_location))
-       pedwarn (input_location, OPT_Wpedantic, "ISO C++ prohibits anonymous 
structs");
+       pedwarn (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (declared_type)),
+                OPT_Wpedantic, "ISO C++ prohibits anonymous structs");
The change looks fine but the in_system_header_at line can be dropped, right?

What do you mean, exactly? Do you mean that, more correctly, we should use DECL_SOURCE_LOCATION for it too or that in fact is and was already completely redundant? I agree with the former, I didn't bother changing it (likely in a couple of other places too) because in practice input_location should work fine anyway as far as noticing that we are in system header is concerned and is simpler. If you mean the latter, I'm not sure, I don't really see why...

Paolo.

Reply via email to