Skip to content

Commit

Permalink
Fix an incorrect note.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Matt Beaumont-Gay committed Aug 23, 2011
1 parent b9dbab1 commit 903d6dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 16 additions & 0 deletions test/SemaCXX/function-redecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 903d6dc

Please sign in to comment.