]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/14479 (enum definition in template class with template methods causes error.)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Sat, 12 Feb 2005 16:29:20 +0000 (16:29 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Sat, 12 Feb 2005 16:29:20 +0000 (16:29 +0000)
PR c++/14479
PR c++/19487
* pt.c (maybe_check_template_type): Remove.
* cp-tree.h (maybe_check_template_type): Remove prototype.
* name-lookup.c (maybe_process_template_type_declaration): Don't
use maybe_check_template_type.

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

From-SVN: r94944

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/name-lookup.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog

index 3dd309960dc5d90d64701f44e400c20d9c203acc..1665ce005f644edd777b6d40f1bee928fdb704c1 100644 (file)
@@ -1,3 +1,12 @@
+2005-02-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/14479
+       PR c++/19487
+       * pt.c (maybe_check_template_type): Remove.
+       * cp-tree.h (maybe_check_template_type): Remove prototype.
+       * name-lookup.c (maybe_process_template_type_declaration): Don't
+       use maybe_check_template_type.
+
 2005-02-10  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/19755
index b2fec24e02b13f7205d63576c6378bb81f2c8cfb..bcb63b865870d802a4ea1e92043fab7453bbfa0f 100644 (file)
@@ -3921,7 +3921,6 @@ extern int is_specialization_of                 (tree, tree);
 extern bool is_specialization_of_friend         (tree, tree);
 extern int comp_template_args                   (tree, tree);
 extern void maybe_process_partial_specialization (tree);
-extern void maybe_check_template_type           (tree);
 extern tree most_specialized_instantiation      (tree);
 extern void print_candidates                    (tree);
 extern int instantiate_pending_templates        (void);
index 0b6dddb01917f62075ec350f897efe029b2dba97..80f4c2946c25e6c64d1d175e901d4f7b7906937a 100644 (file)
@@ -4542,12 +4542,9 @@ maybe_process_template_type_declaration (tree type, int globalize,
     ;
   else
     {
-      maybe_check_template_type (type);
-
       my_friendly_assert (IS_AGGR_TYPE (type)
                          || TREE_CODE (type) == ENUMERAL_TYPE, 0);
 
-
       if (processing_template_decl)
        {
          /* This may change after the call to
index 5409fd31436b16091a7d35d98d71728e685ebc13..45557c108108087ab9af36b0887265b5a1d29a11 100644 (file)
@@ -1997,49 +1997,6 @@ check_explicit_specialization (tree declarator,
   return decl;
 }
 
-/* TYPE is being declared.  Verify that the use of template headers
-   and such is reasonable.  Issue error messages if not.  */
-
-void
-maybe_check_template_type (tree type)
-{
-  if (template_header_count)
-    {
-      /* We are in the scope of some `template <...>' header.  */
-
-      int context_depth 
-       = template_class_depth_real (TYPE_CONTEXT (type),
-                                    /*count_specializations=*/1);
-
-      if (template_header_count <= context_depth)
-       /* This is OK; the template headers are for the context.  We
-          are actually too lenient here; like
-          check_explicit_specialization we should consider the number
-          of template types included in the actual declaration.  For
-          example, 
-
-            template <class T> struct S {
-              template <class U> template <class V>
-              struct I {};
-            }; 
-
-          is invalid, but:
-
-            template <class T> struct S {
-              template <class U> struct I;
-            }; 
-
-            template <class T> template <class U.
-            struct S<T>::I {};
-
-          is not.  */
-       ; 
-      else if (template_header_count > context_depth + 1)
-       /* There are two many template parameter lists.  */
-       error ("too many template parameter lists in declaration of `%T'", type); 
-    }
-}
-
 /* Returns 1 iff PARMS1 and PARMS2 are identical sets of template
    parameters.  These are represented in the same format used for
    DECL_TEMPLATE_PARMS.  */
index 3f2b3797d80f1b4f5da5b5fb4d66f6e820192180..46062a4ba2864a908d7d44185d82411e3297073f 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-12  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/14479
+       PR c++/19487
+       * g++.dg/template/enum5.C: New test.
+
 2005-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/19666