diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-18 18:22:12 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-18 18:22:12 +0000 |
commit | 32d33ab2b6aa8f79eaa31808de566d58d1a85b55 (patch) | |
tree | 3393aa88e335ad0c151ee642c9e17e8807ed52e9 /gcc/c-tree.h | |
parent | 64089cc9f030d8ef7972adb5d117e0b23f47d62b (diff) | |
download | gcc-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-tree.h')
-rw-r--r-- | gcc/c-tree.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-tree.h b/gcc/c-tree.h index f67c4d20796..9b24daa79f5 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -309,6 +309,8 @@ struct c_arg_info { /* A list of non-parameter decls (notably enumeration constants) defined with the parameters. */ tree others; + /* True when these arguments had [*]. */ + BOOL_BITFIELD had_vla_unspec : 1; }; /* A declarator. */ @@ -506,6 +508,7 @@ extern bool c_missing_noreturn_ok_p (tree); extern tree c_objc_common_truthvalue_conversion (tree expr); extern bool c_warn_unused_global_decl (tree); extern void c_initialize_diagnostics (diagnostic_context *); +extern bool c_vla_unspec_p (tree x, tree fn); #define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \ c_build_qualified_type ((TYPE), \ @@ -524,6 +527,7 @@ extern struct c_label_context_vm *label_context_stack_vm; extern tree require_complete_type (tree); extern int same_translation_unit_p (tree, tree); extern int comptypes (tree, tree); +extern bool c_vla_type_p (tree); extern bool c_mark_addressable (tree); extern void c_incomplete_type_error (tree, tree); extern tree c_type_promotes_to (tree); |