+2003-05-31 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10956
+ * pt.c (instantiate_decl): Don't use full template arguments if
+ we are dealing with specializations.
+
2003-05-29 Gabriel Dos Reis <gdr@integrable-solutions.net>
* decl.c (ENABLE_SCOPE_CHECKING): Rename from DEBUG_BINDING_LEVELS.
td = template_for_substitution (d);
code_pattern = DECL_TEMPLATE_RESULT (td);
- if (DECL_NAMESPACE_SCOPE_P (d) && !DECL_INITIALIZED_IN_CLASS_P (d))
+ if ((DECL_NAMESPACE_SCOPE_P (d) && !DECL_INITIALIZED_IN_CLASS_P (d))
+ || DECL_TEMPLATE_SPECIALIZATION (td))
/* In the case of a friend template whose definition is provided
outside the class, we may have too many arguments. Drop the
- ones we don't need. */
+ ones we don't need. The same is true for specializations. */
args = get_innermost_template_args
(gen_args, TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (td)));
else
+2003-05-31 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/10956
+ * g++.dg/template/spec9.C: New test.
+
2003-05-29 Roger Sayle <roger@eyesopen.com>
* gcc.dg/duff-4.c: New test case.
--- /dev/null
+// { dg-do compile }
+
+// Origin: Lynn Akers <lakers@peachtree.com>
+// Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+// PR c++/10956: Incorrect template substitution for member template
+// specialization inside template class.
+
+template <int> struct C {
+ template<typename T> void pre_add(T);
+};
+
+template<>
+template<typename T>
+void C<32>::pre_add(T) {
+ T pre;
+}
+
+int main() {
+ C<32>().pre_add<int>(1);
+}