]> granicus.if.org Git - clang/commitdiff
Fix an incorrect note.
authorMatt Beaumont-Gay <matthewbg@google.com>
Tue, 23 Aug 2011 01:35:51 +0000 (01:35 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Tue, 23 Aug 2011 01:35:51 +0000 (01:35 +0000)
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
test/SemaCXX/function-redecl.cpp

index e45e7dafc62890b93446cecb919769017176e81c..62032e8b65c0925d42d6423b60ee4e4e0532b98f 100644 (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);
index 2ea407cdf5e517da0c8a95585ec90d013b04eebc..b31e42e88adbae7c2f2e34c34fe1b9a660fd2c51 100644 (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;
+}