https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53281
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- FWIW Clang says: cv.cc:4:17: error: member function 'bar1' not viable: 'this' argument has type 'const Foo', but function is not marked const foo.bar1(); ^~~ cv.cc:2:14: note: 'bar1' declared here void bar1() {} ^ 1 error generated. And EDG says: "cv.cc", line 4: error: the object has type qualifiers that are not compatible with the member function object type is: const Foo foo.bar1(); ^ 1 error detected in the compilation of "cv.cc".