]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/28432 (duplicate "no member function declared" message)
authorSteve Ellcey <sje@cup.hp.com>
Thu, 3 Aug 2006 17:16:20 +0000 (17:16 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Thu, 3 Aug 2006 17:16:20 +0000 (17:16 +0000)
PR c++/28432
* decl2.c (check_classfn): Remove early return.
* search.c (lookup_member): Return NULL with bad type.
* g++.dg/other/pr28304.C: Change expected error message.
* g++.dg/other/pr28432.C: New test.

From-SVN: r115908

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr28304.C
gcc/testsuite/g++.dg/other/pr28432.C [new file with mode: 0644]

index 36b753e21dd9aa54f09c661e1ec33fff7ce59193..26631e22c4a04991f74636138b47ff19e4c39ae3 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-03  Steve Ellcey  <sje@cup.hp.com>
+
+       PR c++/28432
+       * decl2.c (check_classfn): Remove early return.
+       * search.c (lookup_member): Return NULL with bad type.
+
 2006-08-03  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27508
index ca8c323071b02c8096cbfced00ae5a3f52ece4f5..f9673eed0db49d9cc35dbac1b0a2582aa891865d 100644 (file)
@@ -710,7 +710,6 @@ check_classfn (tree ctype, tree function, tree template_parms)
     {
       error ("no %q#D member function declared in class %qT",
             function, ctype);
-      return NULL_TREE;
     }
 
   /* If we did not find the method in the class, add it to avoid
index aed8a7aeb0b131daf047f6e244d3995acbc2641a..3eb279170ebc8fb1e24e2d7093092c1501de3ff4 100644 (file)
@@ -1213,7 +1213,8 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
     }
   else
     {
-      gcc_assert (IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)));
+      if (!IS_AGGR_TYPE_CODE (TREE_CODE (xbasetype)))
+       return NULL_TREE;
       type = xbasetype;
       xbasetype = NULL_TREE;
     }
index 71755d9e65060d90683f2c24e077b3072b4c63a5..51ccf8c57e873303fa1420c9abcf54c4e9cb2a5d 100644 (file)
@@ -1,3 +1,9 @@
+2006-08-03  Steve Ellcey  <sje@cup.hp.com>
+
+       PR c++/28432
+       * g++.dg/other/pr28304.C: Change expected error message.
+       * g++.dg/other/pr28432.C: New test.
+
 2006-08-03  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/28250
index 9a0e9cdd791cadeb9d0bba4a11b8c9f09480aacc..c86efd48963724236ff67ba2d33a2d27f390e6b1 100644 (file)
@@ -7,5 +7,5 @@ template<typename T> void A::foo(T) {}  // { dg-error "" }
 
 void bar()
 {
-    A::foo(1); // { dg-error "not a member" }
+    A::foo(1); // { dg-error "no matching function for call" }
 }
diff --git a/gcc/testsuite/g++.dg/other/pr28432.C b/gcc/testsuite/g++.dg/other/pr28432.C
new file mode 100644 (file)
index 0000000..2b9c763
--- /dev/null
@@ -0,0 +1,7 @@
+
+// Test to make sure we do not ICE on this invalid program.
+
+// { dg-options "" }
+
+struct A {};
+void A::foo(); // { dg-error "member function declared in class|outside of class is not definition" }