re PR c++/8660 (template overloading ICE in tsubst_expr, at cp/pt.c:7644)
authorJason Merrill <jason@gcc.gnu.org>
Tue, 11 Mar 2003 10:34:45 +0000 (05:34 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 11 Mar 2003 10:34:45 +0000 (05:34 -0500)
        PR c++/8660
        * decl2.c (check_classfn): A member template only matches a
        member template.

[[Split portion of a mixed commit.]]

From-SVN: r64167.2

gcc/testsuite/g++.dg/template/member2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.mike/err1.C

diff --git a/gcc/testsuite/g++.dg/template/member2.C b/gcc/testsuite/g++.dg/template/member2.C
new file mode 100644 (file)
index 0000000..372c778
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/8660
+// Bug: we were treating the definition of the non-template as a definition
+// of the template, which broke.
+
+struct BadgerBuf
+{
+  void ReadPod();
+  template<class B>
+  void ReadPod();
+};
+
+void BadgerBuf::ReadPod ()
+  { ReadPod<int> (); }
index 8748c7860b155e68d911e5abf177ea3af138c755..3f234bb92a4322b9d81a02fdf33b0a59a88ea504 100644 (file)
@@ -2,7 +2,7 @@
 
 struct gorf {
   int stuff;
-  void snarf();
+  void snarf();                        // ERROR - 
 };
 
 template <class T> void gorf::snarf() { return; }  // ERROR -