From 56381b8502692bb4e6f6cf9b2f71e33895984ba0 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. llvm-svn: 138318 --- clang/lib/Sema/SemaDecl.cpp | 2 +- clang/test/SemaCXX/function-redecl.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index e45e7dafc628..62032e8b65c0 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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/clang/test/SemaCXX/function-redecl.cpp b/clang/test/SemaCXX/function-redecl.cpp index 2ea407cdf5e5..b31e42e88adb 100644 --- a/clang/test/SemaCXX/function-redecl.cpp +++ b/clang/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; +}