+2005-04-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20212
+ * pt.c (regenerate_decl_from_template): Copy attributes for
+ parameters from the pattern to the instantiation.
+
2005-04-05 Mark Mitchell <mark@codesourcery.com>
PR c++/20734
while (decl_parm)
{
tree parm_type;
+ tree attributes;
if (DECL_NAME (decl_parm) != DECL_NAME (pattern_parm))
DECL_NAME (decl_parm) = DECL_NAME (pattern_parm);
parm_type = type_decays_to (parm_type);
if (!same_type_p (TREE_TYPE (decl_parm), parm_type))
TREE_TYPE (decl_parm) = parm_type;
+ attributes = DECL_ATTRIBUTES (pattern_parm);
+ if (DECL_ATTRIBUTES (decl_parm) != attributes)
+ {
+ DECL_ATTRIBUTES (decl_parm) = attributes;
+ cplus_decl_attributes (&decl_parm, attributes, /*flags=*/0);
+ }
decl_parm = TREE_CHAIN (decl_parm);
pattern_parm = TREE_CHAIN (pattern_parm);
}
+2005-04-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/20212
+ * g++.dg/warn/Wunused-11.C: New test.
+
2005-04-06 Bernd Schmidt <bernd.schmidt@analog.com>
* gcc.c-torture/execute/20020720-1.x: Disable on bfin*-*.
--- /dev/null
+// PR c++/20212
+// { dg-options "-O2 -Wunused -Wextra" }
+
+template<int> void f(int);
+void g(int i)
+{
+ f<0>(i);
+}
+template<int> void f(int i __attribute__((unused)) )
+{}
+