[PATCH] D57032: [SemaCXX] Param diagnostic matches overload logic
Brian Gesiak via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 31 19:30:24 PST 2019
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57032.184667.patch
Type: text/x-patch
Size: 1170 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190201/161f66bd/attachment.bin>
More information about the cfe-commits
mailing list