summaryrefslogtreecommitdiff
path: root/gcc/c-objc-common.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-18 18:22:12 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-18 18:22:12 +0000
commit32d33ab2b6aa8f79eaa31808de566d58d1a85b55 (patch)
tree3393aa88e335ad0c151ee642c9e17e8807ed52e9 /gcc/c-objc-common.c
parent64089cc9f030d8ef7972adb5d117e0b23f47d62b (diff)
downloadgcc-32d33ab2b6aa8f79eaa31808de566d58d1a85b55.tar.gz
Fix up vla, vm and [*] sematics.
PR c/18740 PR c/7948 PR c/25802 * c-tree.h (struct c_arg_info): Add had_vla_unspec. (c_vla_unspec_p): Add. (c_vla_type_p): Add. * c-decl.c (struct c_scope): Add had_vla_unspec. (build_array_declarator): Add support for [*]. (grokdeclarator): Likewise. (grokparms): Likewise. (get_parm_info): Likewise. * c-objc-common.c (c_vla_unspec_p): Likewise. * c-objc-common.h (LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P): Likewise. * c-parser.c (c_parser_typeof_specifier): Evaluate arguments to typeof when argument is a variably modified type not inside sizeof or alignof. (c_parser_direct_declarator_inner): Propagate errors. (c_parser_sizeof_expression): Add support for [*]. * c-typeck.c (c_vla_type_p): Add. (composite_type): Add support for vla compositing. (comptypes_internal): Add support for vla compatibility. (c_expr_sizeof_expr): Evaluate vla arguments. * tree.c (variably_modified_type_p): Update comment for [*]. testsuite: * gcc.dg/c90-arraydecl-1.c: Update for vla, vm [*] fixups. * gcc.dg/vla-4.c: Add. * gcc.dg/vla-5.c: Add. * gcc.dg/vla-6.c: Add. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113888 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-objc-common.c')
-rw-r--r--gcc/c-objc-common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 8fcee7330f4..facaeafd82e 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -257,3 +257,11 @@ c_types_compatible_p (tree x, tree y)
{
return comptypes (TYPE_MAIN_VARIANT (x), TYPE_MAIN_VARIANT (y));
}
+
+/* Determine if the type is a vla type for the backend. */
+
+bool
+c_vla_unspec_p (tree x, tree fn ATTRIBUTE_UNUSED)
+{
+ return c_vla_type_p (x);
+}