X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/7804af20a363ed8e94d6e700505870cb4f550730..0aa997a6eaad4cd730ddde283e8b156642510f32:/src/parse-decl.c?ds=sidebyside diff --git a/src/parse-decl.c b/src/parse-decl.c index 42931a3..5c8e684 100644 --- a/src/parse-decl.c +++ b/src/parse-decl.c @@ -27,18 +27,6 @@ #include "i18n.h" #include "normalize.h" -/* - * Determine if a declarator declares an identifier (other than a function - * parameter). - */ -static bool is_abstract(struct cdecl_declarator *d) -{ - while (d->child) - d = d->child; - - return d->type != CDECL_DECL_IDENT; -} - /* * Verify the declaration specifiers of a declaration. If top is true, treat * this as a top-level declaration. Otherwise, treat this as a function @@ -48,7 +36,7 @@ static bool valid_declspecs(struct cdecl *decl, bool top) { struct cdecl_declspec *specs = decl->specifiers; struct cdecl_declarator *d = decl->declarators; - bool abstract = is_abstract(d); + bool abstract = cdecl_is_abstract(d); unsigned num_storage = 0; unsigned long typemap; @@ -456,7 +444,8 @@ struct cdecl *cdecl_parse_decl(const char *declstr) if (!valid_declspecs(i, true)) goto err; - if (is_abstract(i->declarators) && (i != decl || i->next)) { + if (cdecl_is_abstract(i->declarators) + && (i != decl || i->next)) { fprintf(stderr, "mixing type names and declarations is not allowed\n"); goto err; }