aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2006-05-18 18:22:12 +0000
committerMike Stump <mrs@gcc.gnu.org>2006-05-18 18:22:12 +0000
commit52ffd86eb62d0320ccf64138e5d7d37ab7a6f7c5 (patch)
tree3393aa88e335ad0c151ee642c9e17e8807ed52e9 /gcc/tree.c
parent4f9533c7722fa07511a94d005227961f4a4dec23 (diff)
downloadgcc-52ffd86eb62d0320ccf64138e5d7d37ab7a6f7c5.zip
gcc-52ffd86eb62d0320ccf64138e5d7d37ab7a6f7c5.tar.gz
gcc-52ffd86eb62d0320ccf64138e5d7d37ab7a6f7c5.tar.bz2
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. From-SVN: r113888
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 049ec09..c369d60 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5629,11 +5629,7 @@ variably_modified_type_p (tree type, tree fn)
if (type == error_mark_node)
return false;
- /* If TYPE itself has variable size, it is variably modified.
-
- We do not yet have a representation of the C99 '[*]' syntax.
- When a representation is chosen, this function should be modified
- to test for that case as well. */
+ /* If TYPE itself has variable size, it is variably modified. */
RETURN_TRUE_IF_VAR (TYPE_SIZE (type));
RETURN_TRUE_IF_VAR (TYPE_SIZE_UNIT (type));
@@ -5673,7 +5669,7 @@ variably_modified_type_p (tree type, tree fn)
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
- /* We can't see if any of the field are variably-modified by the
+ /* We can't see if any of the fields are variably-modified by the
definition we normally use, since that would produce infinite
recursion via pointers. */
/* This is variably modified if some field's type is. */