Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -5087,7 +5087,7 @@ QualType DefParamTy = Definition->getParamDecl(Idx)->getType(); // The parameter types are identical - if (Context.hasSameType(DefParamTy, DeclParamTy)) + if (Context.hasSameUnqualifiedType(DefParamTy, DeclParamTy)) continue; QualType DeclParamBaseTy = getCoreType(DeclParamTy); Index: test/SemaCXX/function-redecl.cpp =================================================================== --- test/SemaCXX/function-redecl.cpp +++ test/SemaCXX/function-redecl.cpp @@ -125,3 +125,9 @@ } void Foo::beEvil() {} // expected-error {{out-of-line definition of 'beEvil' does not match any declaration in namespace 'redecl_typo::Foo'; did you mean 'BeEvil'?}} } + +struct CVQualFun { + void func(int a, int &b); // expected-note {{type of 2nd parameter of member declaration does not match definition ('int &' vs 'int')}} +}; + +void CVQualFun::func(const int a, int b) {} // expected-error {{out-of-line definition of 'func' does not match any declaration in 'CVQualFun'}}