On 9/2/21 7:53 PM, Martin Sebor wrote:
@@ -4622,28 +4622,94 @@ warn_for_null_address (location_t location, tree op, 
tsubst_flags_t complain)
    if (!warn_address
        || (complain & tf_warning) == 0
        || c_inhibit_evaluation_warnings != 0
-      || warning_suppressed_p (op, OPT_Waddress))
+      || warning_suppressed_p (op, OPT_Waddress)
+      || processing_template_decl != 0)

Completely suppressing this warning in templates seems like a regression; I'd think we could recognize many relevant cases before instantiation. You just can't assume that ADDR_EXPR has the default meaning if it has unknown type (i.e. because op0 is type-dependent).

Jason

Reply via email to