+2005-10-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24139
+ * decl.c (grokdeclarator): Do not require template parameter lists
+ for explicitly specialized class.
+ * error.c (dump_aggr_type): Do not dump template arguments for
+ non-primary specializations.
+ (dump_function_name): Likewise.
+
+ PR c++/24275
+ * pt.c (instantiate_decl): Instantiate the initializer of
+ a static data member in the namespace containing the class
+ containing the static data member.
+
2005-10-08 James A. Morrison <phython@gcc.gnu.org>
PR c++/22172
is correct; there shouldn't be a `template <>' for the
definition of `S<int>::f'. */
- if (CLASSTYPE_TEMPLATE_INFO (t)
- && (CLASSTYPE_TEMPLATE_INSTANTIATION (t)
- || uses_template_parms (CLASSTYPE_TI_ARGS (t)))
+ if (CLASSTYPE_TEMPLATE_SPECIALIZATION (t)
+ && !any_dependent_template_arguments_p (CLASSTYPE_TI_ARGS (t)))
+ /* T is an explicit (not partial) specialization. All
+ containing classes must therefore also be explicitly
+ specialized. */
+ break;
+ if ((CLASSTYPE_USE_TEMPLATE (t) || CLASSTYPE_IS_TEMPLATE (t))
&& PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t)))
template_count += 1;
typdef = !DECL_ARTIFICIAL (name);
tmplate = !typdef && TREE_CODE (t) != ENUMERAL_TYPE
&& TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t)
- && (CLASSTYPE_TEMPLATE_SPECIALIZATION (t)
- || TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL
- || DECL_TEMPLATE_SPECIALIZATION (CLASSTYPE_TI_TEMPLATE (t))
+ && (TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL
|| PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t)));
dump_scope (CP_DECL_CONTEXT (name), flags | TFF_SCOPE);
if (tmplate)
if (DECL_TEMPLATE_INFO (t)
&& !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t)
- && (DECL_TEMPLATE_SPECIALIZATION (t)
- || TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL
- || DECL_TEMPLATE_SPECIALIZATION (DECL_TI_TEMPLATE (t))
+ && (TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL
|| PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))))
dump_template_parms (DECL_TEMPLATE_INFO (t), !DECL_USE_TEMPLATE (t), flags);
}
+2005-10-10 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/24139
+ * g++.dg/template/spec27.C: New test.
+
+ PR c++/24275
+ * g++.dg/template/static19.C: New test.
+
2005-10-09 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/20050922-1.c: Skip on Solaris 2.5.1 to 9.
--- /dev/null
+// PR c++/24139
+
+template<typename T>
+struct O {
+ struct I;
+};
+
+template<>
+struct O<int>::I
+{
+ I();
+};
+
+O<int>::I::I() {}