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

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jul 26 17:05:00 GMT 2015


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

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Author: ppalka
Date: Sun Jul 26 17:04:31 2015
New Revision: 226236

URL: https://gcc.gnu.org/viewcvs?rev=226236&root=gcc&view=rev
Log:
Fix PR c++/18969 (invalid return statement diagnosed too late)

gcc/cp/ChangeLog:

        PR c++/18969
        * typeck.c (check_return_expr): Also do the basic return-value
        validity checking if processing_template_decl and yet types are
        not dependent.  Remove obsolete code.

gcc/testsuite/ChangeLog:

        PR c++/18969
        * g++.dg/template/pr18969.C: New test.
        * g++.dg/template/pr18969-2.C: New test.
        * g++.old-deja/g++.jason/overload.C: Remove return value in
        template function returning void.


Added:
    trunk/gcc/testsuite/g++.dg/template/pr18969-2.C
    trunk/gcc/testsuite/g++.dg/template/pr18969.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.old-deja/g++.jason/overload.C



More information about the Gcc-bugs mailing list