+/*
+ * Find the tree pointer which leads to the parameter's leaf node.
+ *
+ * Return a null pointer if the traversal locates a syntactic element which
+ * prevents function reduction. This occurs if the leaf node declares an
+ * identifier, or for nontrivial fake function parameters (see below).
+ */
+static struct cdecl_declarator **leaf_pointer(struct cdecl *param)
+{
+ struct cdecl_declarator *d, **p = ¶m->declarators;
+
+ if ((param = fake_function_param(param->declarators))) {
+ if (param->declarators->type != CDECL_DECL_NULL)
+ return NULL; /* e.g. int (x (*)) */
+ }
+
+ while ((d = *p)->child) {
+ p = &d->child;
+
+ if (fake_function_param(d->child))
+ return NULL; /* e.g. int (x (*)[][1]) */
+ }
+
+ if (d->type != CDECL_DECL_NULL)
+ return NULL; /* e.g. int (x y) */
+
+ return p;
+}
+
+