On 9/17/21 12:44, Barrett Adair wrote:
I think the patch is in good shape now, thanks for the help.

canon-type*.C fail with trunk and pass with patch, dependent-name*.C are regression tests that pass with both. I removed the dg-ice from constexpr-52830.C. I didn't dig much into the churn history there, but the test code looks valid to me and clang agrees.

I also returned the copyright assignment form yesterday to ass...@gnu.org <mailto:ass...@gnu.org>.

+/* Identify any expressions that use function parms */

A comment should end with a period and two spaces.

+static tree
+find_parm_usage_r (tree tp, int *walk_subtrees, void)
+{
+  tree t = *tp;
+  if (PACK_EXPANSION_P (t) || (TREE_CODE (t) == PARM_DECL))

PACK_EXPANSION_P is wrong here; a pack expansion might not involve a function parameter (pack) at all. And walk_tree should already recurse into the pattern of a pack expansion, so handling them specifically here shouldn't be necessary.

+             else if (!current_function_decl

This needs a comment about why we're checking current_function_decl (because we only need structural comparison for redeclaration comparisons)

+                      && dependent_template_arg_p (arg)
+                      && cp_walk_tree_without_duplicates (&arg,
+                           find_parm_usage_r, NULL))

Here the second line of args needs to line up with the args on the previous line. When that's too far to the right, like here, I tend to write e.g.

> +                 && (cp_walk_tree_without_duplicates
> +                     (&arg, find_parm_usage_r, NULL)))

Jason

Reply via email to