diff options
author | Michael Forney <mforney@mforney.org> | 2024-04-06 13:37:21 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2024-04-06 13:44:37 -0700 |
commit | b7098ab7d4b48a79247679ae8d7e28a7f3bb0910 (patch) | |
tree | abb1a788338f85def7058c636129af327651b89c | |
parent | 177b1f4ba2780db1073654b5fdd39480492dab1b (diff) |
expr: Check that _Generic association type has complete object type
-rw-r--r-- | expr.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -598,6 +598,10 @@ generic(struct scope *s) t = typename(s, &qual); if (!t) error(&tok.loc, "expected typename for generic association"); + if (t->kind == TYPEFUNC) + error(&tok.loc, "generic association must have object type"); + if (t->incomplete) + error(&tok.loc, "generic association must have complete type"); expect(TCOLON, "after type name"); e = assignexpr(s); if (typecompatible(t, want) && qual == QUALNONE) { |