[cfe-commits] r138318 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/function-redecl.cpp

Matt Beaumont-Gay matthewbg at google.com
Mon Aug 22 18:35:51 PDT 2011


Author: matthewbg
Date: Mon Aug 22 20:35:51 2011
New Revision: 138318

URL: http://llvm.org/viewvc/llvm-project?rev=138318&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/test/SemaCXX/function-redecl.cpp

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=138318&r1=138317&r2=138318&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Aug 22 20:35:51 2011
@@ -2924,7 +2924,7 @@
     QualType DefParamTy = Definition->getParamDecl(Idx)->getType();
 
     // The parameter types are identical
-    if (DefParamTy == DeclParamTy)
+    if (Context.hasSameType(DefParamTy, DeclParamTy))
       continue;
 
     QualType DeclParamBaseTy = getCoreType(DeclParamTy);

Modified: cfe/trunk/test/SemaCXX/function-redecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/function-redecl.cpp?rev=138318&r1=138317&r2=138318&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/function-redecl.cpp (original)
+++ cfe/trunk/test/SemaCXX/function-redecl.cpp Mon Aug 22 20:35:51 2011
@@ -54,3 +54,19 @@
 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;
+}





More information about the cfe-commits mailing list