[Bug c++/18969] Invalid return statement diagnosed too late

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 8 02:43:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18969

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Breakpoint 5, check_return_expr (retval=<integer_cst 0x7ffff7408720>,
no_warning=0x7fffffffdf2f) at /home/manuel/test1/src/gcc/cp/typeck.c:8311

B =>if (processing_template_decl)
      {
        current_function_returns_value = 1;
        if (check_for_bare_parameter_packs (retval))
          retval = error_mark_node;
        return retval;
      }

processing_template_decl is a big hammer here. We only should care about the
return type of the function or the type of the thing being returned. If those
are not dependent, then we should just give diagnostics. But we also need a way
to not repeat the diagnostics when instantiated.

It doesn't seem trivial to me.


More information about the Gcc-bugs mailing list