re PR c++/88554 (Segfault ICE when falling off the end of a reference-returning frien...
authorJonathan Wakely <jwakely@redhat.com>
Tue, 8 Jan 2019 08:57:58 +0000 (08:57 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 8 Jan 2019 08:57:58 +0000 (09:57 +0100)
commitff0425cdeb49db33d4bfe736829005544b45e659
tree2543158574fdc0776e2b1b7f480d733de18aedff
parent44e813ecd1fa610e3e4ed2420a69d4a1e200b19c
re PR c++/88554 (Segfault ICE when falling off the end of a reference-returning friend operator)

PR c++/88554
* decl.c (finish_function): For -Wreturn-type don't add a return *this;
fixit hint if current_class_ref is NULL.  Use a single if instead of
two nested ones.

* g++.dg/warn/Wreturn-type-11.C: New test.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r267672
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wreturn-type-11.C [new file with mode: 0644]