re PR c++/11513 (ICE in push_template_decl_real cp/pt.c:2755, template member functions)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Thu, 24 Jul 2003 11:56:33 +0000 (11:56 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Thu, 24 Jul 2003 11:56:33 +0000 (11:56 +0000)
PR c++/11513
* cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope.

* g++.dg/template/crash8.C: New test.

From-SVN: r69739

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/crash8.C [new file with mode: 0644]

index 3314b35c1588209b6645bc823dd43e977dbc6c83..337b372e27e8b820c5d4cc75252e301938eaf654 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/11513
+       * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope.
+
 2003-07-23  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/11645
index 15bcea07eee7f1281a76803b4556af477708753c..8e3fcf7701a9b3a6bb88b82c7e02cc0e51ccdd7c 100644 (file)
@@ -2838,7 +2838,7 @@ struct lang_decl GTY(())
    entity with its own template parameter list, and which is not a
    full specialization.  */
 #define PROCESSING_REAL_TEMPLATE_DECL_P() \
-  (processing_template_decl > template_class_depth (current_class_type))
+  (processing_template_decl > template_class_depth (current_scope ()))
 
 /* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
    instantiated, i.e. its definition has been generated from the
index 4881e5ae45b26627d0840bd6282519430e54e4ed..a362729dc8413533b9d5df247e81caa01875a72d 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-24  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/11513
+       * g++.dg/template/crash8.C: New test.
+
 2003-07-23  Steven Bosscher <steven@gcc.gnu.org>
 
        PR c/10602
diff --git a/gcc/testsuite/g++.dg/template/crash8.C b/gcc/testsuite/g++.dg/template/crash8.C
new file mode 100644 (file)
index 0000000..a6f26b3
--- /dev/null
@@ -0,0 +1,20 @@
+// { dg-do compile }
+
+// Origin: David Robinson <drtr@dial.pipex.com>
+
+// PR c++/11513: ICE due to incorrect decision whether the tag is template.
+
+template <typename T>
+struct bar
+{ 
+  struct foo
+  {
+    int a;
+  };
+
+  template <typename U>
+  int wom(U c)
+  {
+    struct foo b;
+  }
+};