[Bug c++/71495] [6/7 Regression] Spurious "note: initializing argument ... of ..." without any warning/error

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 10 21:05:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71495

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Alexander Monakov from comment #2)
> Created attachment 38683 [details]
> reduced testcase
> 
> Adding a delta-reduced testcase that fails on trunk.

Having a reduced testcase is nice, but I think this can be debugged without
one. Just break in all places that call inform() with that string. There are 6.
I think some of the following may generate warnings, thus the inform should
only be called if the warning/pedwarn/permerror call returned true.


    case ck_ambig:
      /* We leave bad_p off ck_ambig because overload resolution considers
         it valid, it just fails when we try to perform it.  So we need to
         check complain here, too.  */
      if (complain & tf_error)
        {
          /* Call build_user_type_conversion again for the error.  */
          build_user_type_conversion (totype, convs->u.expr, LOOKUP_NORMAL,
                                      complain);
          if (fn)
            inform (DECL_SOURCE_LOCATION (fn),
                    "  initializing argument %P of %qD", argnum, fn);
        }
      return error_mark_node;

and

    case ck_rvalue:
      expr = decay_conversion (expr, complain);
      if (expr == error_mark_node)
        {
          if (complain)
            {
              maybe_print_user_conv_context (convs);
              if (fn)
                inform (DECL_SOURCE_LOCATION (fn),
                        "  initializing argument %P of %qD", argnum, fn);
            }
          return error_mark_node;
        }
and

      expr = build_temp (expr, totype, flags, &diag_kind, complain);
      if (diag_kind && complain)
        {
          maybe_print_user_conv_context (convs);
          if (fn)
            inform (DECL_SOURCE_LOCATION (fn),
                    "  initializing argument %P of %qD", argnum, fn);
        }


More information about the Gcc-bugs mailing list