Index: lib/Sema/SemaExprCXX.cpp =================================================================== --- lib/Sema/SemaExprCXX.cpp +++ lib/Sema/SemaExprCXX.cpp @@ -5105,6 +5105,7 @@ // Cast LHS to type of use. QualType UseType = isIndirect ? Context.getPointerType(Class) : Class; + UseType = UseType.withCVRQualifiers(LHS.get()->getType().getCVRQualifiers()); ExprValueKind VK = isIndirect ? VK_RValue : LHS.get()->getValueKind(); LHS = ImpCastExprToType(LHS.get(), UseType, CK_DerivedToBase, VK, &BasePath); Index: test/SemaCXX/PR27037.cpp =================================================================== --- /dev/null +++ test/SemaCXX/PR27037.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +struct A { + void f(); +}; + +struct B : A {}; + +void m() { + const B b; + (b.*&B::f)(); // expected-error{{drops 'const' qualifier}} +}