https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89831
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Wed Mar 27 20:39:19 2019 New Revision: 269977 URL: https://gcc.gnu.org/viewcvs?rev=269977&root=gcc&view=rev Log: PR c++/89831 - error with qualified-id in const member function. Since the fix for 15272 we were remembering the wrong function to use at instantiation time, because the type of the SCOPE_REF didn't reflect the cv-quals of 'this'. Conveniently, we can fix this by simplifying the code. * semantics.c (finish_non_static_data_member): Use object cv-quals in scoped case, too. Added: trunk/gcc/testsuite/g++.dg/template/scope6.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c