C++: show private field accessor hints with -g and optimization (PR c++/84994)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 21 Mar 2018 18:21:39 +0000 (18:21 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 21 Mar 2018 18:21:39 +0000 (18:21 +0000)
commit5afef8b119ac69393900a8be42cc6b69ad0bcbd0
tree48589739cf60c87d4370d731f0c5249f6d771e0c
parentaa3dd75327228f00df19070afac6a99a06b04f60
C++: show private field accessor hints with -g and optimization (PR c++/84994)

gcc/cp/ChangeLog:
PR c++/84994
* constexpr.c (constexpr_fn_retval): Make non-"static".
* cp-tree.h (constexpr_fn_retval): New decl.
* search.c (direct_accessor_p): Update leading comment.
(reference_accessor_p): Likewise.
(field_accessor_p): Replace check that function body is a
RETURN_EXPR with a call to constexpr_fn_retval.  Fix
indentation of "field_type" decl.

gcc/testsuite/ChangeLog:
PR c++/84994
* g++.dg/other/accessor-fixits-1.C: Move to...
* g++.dg/torture/accessor-fixits-1.C: ...here.
* g++.dg/other/accessor-fixits-2.C: Move to...
* g++.dg/torture/accessor-fixits-2.C: ...here.
* g++.dg/other/accessor-fixits-3.C: Move to...
* g++.dg/torture/accessor-fixits-3.C: ...here.
* g++.dg/other/accessor-fixits-4.C: Move to...
* g++.dg/torture/accessor-fixits-4.C: ...here.
* g++.dg/other/accessor-fixits-5.C: Move to...
* g++.dg/torture/accessor-fixits-5.C: ...here.
* g++.dg/torture/accessor-fixits-6.C: New testcase.
* g++.dg/torture/accessor-fixits-7.C: New testcase.
* g++.dg/torture/accessor-fixits-8.C: New testcase.

From-SVN: r258731
18 files changed:
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/accessor-fixits-1.C [deleted file]
gcc/testsuite/g++.dg/other/accessor-fixits-2.C [deleted file]
gcc/testsuite/g++.dg/other/accessor-fixits-3.C [deleted file]
gcc/testsuite/g++.dg/other/accessor-fixits-4.C [deleted file]
gcc/testsuite/g++.dg/other/accessor-fixits-5.C [deleted file]
gcc/testsuite/g++.dg/torture/accessor-fixits-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/accessor-fixits-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/accessor-fixits-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/accessor-fixits-4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/accessor-fixits-5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/accessor-fixits-6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/accessor-fixits-7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/torture/accessor-fixits-8.C [new file with mode: 0644]