re PR c++/7718 ('complex' template instantiation causes internal compiler error ...
authorNathan Sidwell <nathan@codesourcery.com>
Mon, 16 Sep 2002 19:57:33 +0000 (19:57 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 16 Sep 2002 19:57:33 +0000 (19:57 +0000)
cp:
PR c++/7718
* pt.c (tsubst_decl): Remove assert.
testsuite:
* g++.dg/template/subst1.C: New test.

From-SVN: r57211

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/subst1.C [new file with mode: 0644]

index a405a9114ebc98f2a3a90250f8076355e6cd5778..9b6bcdcbd8880b166c33d0fb85be972076dbd58b 100644 (file)
@@ -1,5 +1,8 @@
 2002-09-16  Nathan Sidwell  <nathan@codesourcery.com>
 
+       PR c++/7718
+       * pt.c (tsubst_decl): Remove assert.
+
        Remove DR 295 implementation.
        * pt.c (check_cv_quals_for_unify): Disable function & method cases.
        * tree.c (cp_build_qualified_type_real): Likewise. Don't warn
index 86b3fc20d8eddf425fe59537de12a323fee702f8..64696bcdbc96ff7e61f7bb3ee17a6a0cad11029f 100644 (file)
@@ -5694,8 +5694,6 @@ tsubst_decl (t, args, type, complain)
   tree r = NULL_TREE;
   tree in_decl = t;
 
-  my_friendly_assert (complain & tf_error, 20011214);
-  
   /* Set the filename and linenumber to improve error-reporting.  */
   saved_lineno = lineno;
   saved_filename = input_filename;
index e399a34b141551a59377180b4b0935ec7b83c373..63b882ffbaea7b8fee0e79cb692b1ade8724459f 100644 (file)
@@ -1,9 +1,17 @@
+2002-09-16  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.dg/template/subst1.C: New test.
+       
 2002-09-16  Steve Ellcey  <sje@cup.hp.com>
 
        * gcc.dg/20020312-2.c: Change __parisc__ to __hppa__.
 
 2002-09-16  Nathan Sidwell  <nathan@codesourcery.com>
 
+       * g++.dg/template/qualttp20.C: Adjust expected errors.
+       * g++.old-deja/g++.jason/report.C: Likewise.
+       * g++.old-deja/g++.other/qual1.C: Likewise.
+
        * g++.dg/lookup/scoped2.C: New test.
 
        * g++.dg/ext/asm3.C: New test.
diff --git a/gcc/testsuite/g++.dg/template/subst1.C b/gcc/testsuite/g++.dg/template/subst1.C
new file mode 100644 (file)
index 0000000..827af23
--- /dev/null
@@ -0,0 +1,27 @@
+// { dg-do compile }
+
+// Copyright (C) 2002 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 16 Sep 2002 <nathan@codesourcery.com>
+
+// PR 7718. ICE.
+
+template <typename OBJECT>
+void default_initializer(const OBJECT &) { }
+
+
+template <typename OBJECT, void init_function(const OBJECT &)>
+class cContainer {
+  public:
+  template <typename INITIALIZER>
+  void Add(const INITIALIZER &initializer) {
+    init_function(initializer);
+  }
+};
+
+int main() {
+  cContainer<int, default_initializer<int> > c;
+  
+  c.Add<int>(42);
+  
+  return 0;
+}