]> git.draconx.ca Git - cdecl99.git/commitdiff
libcdecl: Simplify mixed type name error condition.
authorNick Bowler <nbowler@draconx.ca>
Sat, 1 Jul 2023 03:03:09 +0000 (23:03 -0400)
committerNick Bowler <nbowler@draconx.ca>
Sun, 2 Jul 2023 00:16:07 +0000 (20:16 -0400)
"List item X is either not the first or not the last item" is just a
very complicated way to say "the list has more than one item".

src/parse-decl.c

index 6ab624e4f30d0a15acd29dd9f05e7fd616c46258..3137859708b5745d24ec489309efd97a0edfdd69 100644 (file)
@@ -514,8 +514,8 @@ static int do_postprocess(struct cdecl *decl, int english_mode)
                if (!valid_declspecs(i, true))
                        return 0;
 
-               if (cdecl_is_abstract(i->declarators)
-                   && (i != decl || i->next)) {
+               if (decl->next && cdecl_is_abstract(i->declarators)) {
+                       /* Abstract full declarators: there can only be one. */
                        cdecl__errmsg(CDECL__EDECLTYPE);
                        return 0;
                }