With no longer visiting TREE_CHAIN for decls we have to visit
the DECL_ARGUMENT chain manually.
PR lto/121935
* ipa-free-lang-data.cc (find_decls_types_r): Visit DECL_ARGUMENTS
chain manually.
* g++.dg/lto/pr121935_0.C: New testcase.
if (TREE_CODE (t) == FUNCTION_DECL)
{
- fld_worklist_push (DECL_ARGUMENTS (t), fld);
+ for (tree arg = DECL_ARGUMENTS (t); arg; arg = DECL_CHAIN (arg))
+ fld_worklist_push (arg, fld);
fld_worklist_push (DECL_RESULT (t), fld);
}
else if (TREE_CODE (t) == FIELD_DECL)
--- /dev/null
+// { dg-lto-do assemble }
+// { dg-lto-options {{-flto -Wno-return-type}} }
+
+struct a {
+ static int b;
+};
+template <int> struct c {
+ struct d {
+ d e(unsigned, unsigned, bool, bool, bool, unsigned, a);
+ };
+};
+template <>
+c<2>::d c<2>::d::e(unsigned, unsigned, bool, bool, bool, unsigned, const a) { }