+2005-03-09 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20208
+ * pt.c (tsubst_decl): Apply array-to-pointer and
+ function-to-pointer conversions to function arguments.
+ (regenerate_decl_from_template): Likewise.
+
2005-03-09 Paolo Carlini <pcarlini@suse.de>
PR c++/16859
SET_DECL_TEMPLATE_PARM_P (r);
type = tsubst (TREE_TYPE (t), args, complain, in_decl);
+ type = type_decays_to (type);
TREE_TYPE (r) = type;
cp_apply_type_quals_to_decl (cp_type_quals (type), r);
DECL_NAME (decl_parm) = DECL_NAME (pattern_parm);
parm_type = tsubst (TREE_TYPE (pattern_parm), args, tf_error,
NULL_TREE);
+ parm_type = type_decays_to (parm_type);
if (!same_type_p (TREE_TYPE (decl_parm), parm_type))
TREE_TYPE (decl_parm) = parm_type;
decl_parm = TREE_CHAIN (decl_parm);
--- /dev/null
+// PR c++/20208
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C" void abort();
+
+template <typename T>
+inline void *Foo (T arg) { return &arg[0]; }
+
+int main () {
+ int bry[2];
+ if (Foo<int[2]>(bry) != bry)
+ abort();
+}