C++: show private field accessor hints for const accesses (PR c++/84892)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 21 Mar 2018 13:09:09 +0000 (13:09 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 21 Mar 2018 13:09:09 +0000 (13:09 +0000)
commit2a80d3ae14f6f823e28637fd28b5808a6e4aa5ba
tree86d55601cfd0c25ca63798a94855f2a8ef645709
parent8bb406a2916060d123a97974072ceb74ac9c92cc
C++: show private field accessor hints for const accesses (PR c++/84892)

gcc/cp/ChangeLog:
PR c++/84892
* search.c (field_accessor_p): Use class_of_this_parm rather than
type_of_this_parm, to check that "this" is a "const T *", rather
than a "T *const".

gcc/testsuite/ChangeLog:
PR c++/84892
* g++.dg/other/accessor-fixits-1.C
(test_access_const_t1_color): New.
(test_deref_const_t1_color): New.
* g++.dg/other/accessor-fixits-5.C: New testcase.

From-SVN: r258716
gcc/cp/ChangeLog
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/accessor-fixits-1.C
gcc/testsuite/g++.dg/other/accessor-fixits-5.C [new file with mode: 0644]