From f85db99ff0b48b5837fa985dcf9c58190b35f96a Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 24 Mar 2016 15:44:01 +0100 Subject: Fix type parsing the check on incomplete struct/union/enum types was too early, disallowing mixed specifiers and qualifiers. Simply rely on the size (->c) field for that. See testcases. --- tests/tests2/61_undefined_enum.expect | 2 +- tests/tests2/81_types.c | 9 +++++++++ tests/tests2/81_types.expect | 0 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/tests2/81_types.c create mode 100644 tests/tests2/81_types.expect (limited to 'tests/tests2') diff --git a/tests/tests2/61_undefined_enum.expect b/tests/tests2/61_undefined_enum.expect index 7ccdeca..eb8b774 100644 --- a/tests/tests2/61_undefined_enum.expect +++ b/tests/tests2/61_undefined_enum.expect @@ -1 +1 @@ -61_undefined_enum.c:1: error: unknown struct/union/enum +61_undefined_enum.c:1: error: unknown type size diff --git a/tests/tests2/81_types.c b/tests/tests2/81_types.c new file mode 100644 index 0000000..542d066 --- /dev/null +++ b/tests/tests2/81_types.c @@ -0,0 +1,9 @@ +/* The following are all valid decls, even though some subtypes + are incomplete. */ +enum E *e; +const enum E *e1; +enum E const *e2; +struct S *s; +const struct S *s1; +struct S const *s2; +int main () { return 0; } diff --git a/tests/tests2/81_types.expect b/tests/tests2/81_types.expect new file mode 100644 index 0000000..e69de29 -- cgit v1.3.1