Fix PR c++/18969 (invalid return statement diagnosed too late)
authorPatrick Palka <ppalka@gcc.gnu.org>
Sun, 26 Jul 2015 17:04:31 +0000 (17:04 +0000)
committerPatrick Palka <ppalka@gcc.gnu.org>
Sun, 26 Jul 2015 17:04:31 +0000 (17:04 +0000)
commit11f2c78ae877382e2c25313b520aaf9b4e111be6
tree07d1909c8fdadd4a61a5000e8ed989ebebe54fa2
parentaf7186706c6cd7d5014f0637308c80d8f2cd2545
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.

From-SVN: r226236
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/pr18969-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/template/pr18969.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.jason/overload.C