]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/28304 (ICE looking up invalid member template)
authorSteve Ellcey <sje@cup.hp.com>
Tue, 18 Jul 2006 17:25:40 +0000 (17:25 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Tue, 18 Jul 2006 17:25:40 +0000 (17:25 +0000)
PR c++/28304
* decl2.c (check_classfn): Return NULL_TREE on error.
* g++.dg/other/pr28304.C: New test.

From-SVN: r115563

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

index 03438d522d46891f79bd2ac6475ba9202dc6a549..babd2f41d73d32c0287259770e5aa036c52f317d 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-18  Steve Ellcey  <sje@cup.hp.com>
+
+       PR c++/28304
+       * decl2.c (check_classfn): Return NULL_TREE on error.
+
 2006-07-17  Lee Millward  <lee.millward@gmail.com>
 
        PR c++/28051
index 776d8baabdaa951c49fb0e2974c4216191735271..ca8c323071b02c8096cbfced00ae5a3f52ece4f5 100644 (file)
@@ -707,8 +707,11 @@ check_classfn (tree ctype, tree function, tree template_parms)
   else if (!COMPLETE_TYPE_P (ctype))
     cxx_incomplete_type_error (function, ctype);
   else
-    error ("no %q#D member function declared in class %qT",
-          function, ctype);
+    {
+      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
      spurious errors (unless the CTYPE is not yet defined, in which
index fabfec9268d7953fb42a5a0147548da8a9cbbb0e..5f15fb089d56da39d6acd3d2cb9ea751924ef856 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-18  Steve Ellcey  <sje@cup.hp.com>
+
+       PR c++/28304
+       * g++.dg/other/pr28304.C: New test.
+
 2006-07-18  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c/28286
diff --git a/gcc/testsuite/g++.dg/other/pr28304.C b/gcc/testsuite/g++.dg/other/pr28304.C
new file mode 100644 (file)
index 0000000..9a0e9cd
--- /dev/null
@@ -0,0 +1,11 @@
+
+// Test to make sure we do not ICE on this invalid program.
+
+struct A {};
+
+template<typename T> void A::foo(T) {}  // { dg-error "" }
+
+void bar()
+{
+    A::foo(1); // { dg-error "not a member" }
+}