This revision was automatically updated to reflect the committed changes. Closed by commit rC352831: [SemaCXX] Param diagnostic matches overload logic (authored by modocache, committed by ).
Changed prior to commit: https://reviews.llvm.org/D57032?vs=184284&id=184667#toc Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57032/new/ https://reviews.llvm.org/D57032 Files: lib/Sema/SemaDecl.cpp test/SemaCXX/function-redecl.cpp 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'}} 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'}} 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);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits