On 2/4/21 10:02 AM, Anthony Sharp via Gcc-patches wrote:
Hello,

New bugfix for PR19377
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19377). This is
basically an extension of what I did before for PR17314 except it also
fixes this other bug.

I hope I didn't over-comment in the code ... better to say too much
than too little! It's a niche bug so I thought it could do with a
little explanation.

Yes, thanks; it would take a lot to make me request less comments.

+      if (TREE_CODE (parent_field) == USING_DECL)
+       {
+         if (cp_tree_equal (decl,
+                            lookup_member (parent_binfo,
+                                           DECL_NAME (parent_field),
+                                           /*protect=*/0,
+                                           /*want_type=*/false,
+                                           tf_warning_or_error)))

Isn't it sufficient to check that the names match?

          tree parent_binfo = get_parent_with_private_access (decl,
-                                                             basetype_path);
+                                                              basetype_path);
...
+             diag_location = get_class_access_diagnostic_decl (parent_binfo,
+                                                                diag_decl);

The second lines of arguments are indented one space too far in both these calls.

Jason

Reply via email to