+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
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);
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. */
+2005-02-12 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/14479
+ PR c++/19487
+ * g++.dg/template/enum5.C: New test.
+
2005-02-12 Ira Rosen <irar@il.ibm.com>
* gcc.dg/vect/vect-97.c: New test.
--- /dev/null
+// { dg-do compile }
+
+// Origin: robertk@mathematik.uni-freiburg.de
+// Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+// PR c++/14479: Template header check for enum
+
+template <int dim>
+struct X {
+ enum { dimension = dim };
+ template<int d> void bar ();
+};
+
+template <>
+template <>
+void X<0>::bar<0> () {}