diff options
author | Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> | 2005-02-12 15:40:28 +0000 |
---|---|---|
committer | Kriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org> | 2005-02-12 15:40:28 +0000 |
commit | d32707707a3a320f338839639c54227d97b95e5a (patch) | |
tree | 33ea4be8f2077053e45e74021169caa2629e37ec /gcc/cp | |
parent | 537677ba9d5fb2dfc6b64d0feb464fee0b7f6390 (diff) | |
download | gcc-d32707707a3a320f338839639c54227d97b95e5a.zip gcc-d32707707a3a320f338839639c54227d97b95e5a.tar.gz gcc-d32707707a3a320f338839639c54227d97b95e5a.tar.bz2 |
re PR c++/14479 (enum definition in template class with template methods causes error.)
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: r94941
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 1 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 2 | ||||
-rw-r--r-- | gcc/cp/pt.c | 43 |
4 files changed, 9 insertions, 46 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9e67a94..b60b6de 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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-11 Richard Henderson <rth@redhat.com> PR c++/19632 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 0b4959b..bd5d0ec 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4010,7 +4010,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 void instantiate_pending_templates (int); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index b72ded0..7d944d0 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4514,8 +4514,6 @@ maybe_process_template_type_declaration (tree type, int globalize, ; else { - maybe_check_template_type (type); - gcc_assert (IS_AGGR_TYPE (type) || TREE_CODE (type) == ENUMERAL_TYPE); if (processing_template_decl) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d484c8b..b131213 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2101,49 +2101,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 %qT", 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. */ |