From 903d6dc86bf3b6346d23607c850d3bc83a36b826 Mon Sep 17 00:00:00 2001 From: Matt Beaumont-Gay Date: Tue, 23 Aug 2011 01:35:51 +0000 Subject: [PATCH] Fix an incorrect note. For the test case added to function-redecl.cpp, we were previously complaining about a mismatch in the parameter types, since the definition used the typedef'd type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138318 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 2 +- test/SemaCXX/function-redecl.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index e45e7dafc6..62032e8b65 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2924,7 +2924,7 @@ static bool isNearlyMatchingFunction(ASTContext &Context, QualType DefParamTy = Definition->getParamDecl(Idx)->getType(); // The parameter types are identical - if (DefParamTy == DeclParamTy) + if (Context.hasSameType(DefParamTy, DeclParamTy)) continue; QualType DeclParamBaseTy = getCoreType(DeclParamTy); diff --git a/test/SemaCXX/function-redecl.cpp b/test/SemaCXX/function-redecl.cpp index 2ea407cdf5..b31e42e88a 100644 --- a/test/SemaCXX/function-redecl.cpp +++ b/test/SemaCXX/function-redecl.cpp @@ -54,3 +54,19 @@ void B::Notypocorrection(int) { // expected-error {{out-of-line definition of 'N struct X { int f(); }; struct Y : public X {}; int Y::f() { return 3; } // expected-error {{out-of-line definition of 'f' does not match any declaration in 'Y'}} + +namespace test1 { +struct Foo { + class Inner { }; +}; +} + +class Bar { + void f(test1::Foo::Inner foo) const; // expected-note {{member declaration nearly matches}} +}; + +using test1::Foo; + +void Bar::f(Foo::Inner foo) { // expected-error {{out-of-line definition of 'f' does not match any declaration in 'Bar'}} + (void)foo; +} -- 2.40.0