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
This commit is contained in:
Matt Beaumont-Gay 2011-08-23 01:35:51 +00:00
parent 2a3ffb5d97
commit 56381b8502
2 changed files with 17 additions and 1 deletions

View File

@ -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);

View File

@ -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;
}