[qfcc] Support type expressions in default_type

Needed for using type expressions in casts (eg in generic functions).
This commit is contained in:
Bill Currie 2024-12-11 02:46:47 +09:00
parent b2049f496b
commit c8158f9ebe

View file

@ -538,7 +538,7 @@ default_type (specifier_t spec, const symbol_t *sym)
spec.type = &type_uint; spec.type = &type_uint;
} }
} }
} else { } else if (!spec.type_expr) {
if (spec.is_long) { if (spec.is_long) {
if (spec.is_unsigned) { if (spec.is_unsigned) {
spec.type = type_ulong_uint; spec.type = type_ulong_uint;
@ -553,7 +553,7 @@ default_type (specifier_t spec, const symbol_t *sym)
} }
} }
} }
if (!spec.type) { if (!spec.type && !spec.type_expr) {
spec.type = type_default; spec.type = type_default;
if (sym) { if (sym) {
warning (0, "type defaults to '%s' in declaration of '%s'", warning (0, "type defaults to '%s' in declaration of '%s'",