diff options
author | Richard Henderson <rth@redhat.com> | 2005-03-29 17:35:15 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2005-03-29 17:35:15 -0800 |
commit | aab038d54ae4614f347c0b446ff505fc204ad38e (patch) | |
tree | c268ffdf655de9176ff5a95683d1e4bfc230ad87 /gcc/cp/typeck2.c | |
parent | 748e31c32624a6da22db9330601faf19aaf24f05 (diff) | |
download | gcc-aab038d54ae4614f347c0b446ff505fc204ad38e.zip gcc-aab038d54ae4614f347c0b446ff505fc204ad38e.tar.gz gcc-aab038d54ae4614f347c0b446ff505fc204ad38e.tar.bz2 |
re PR c/20519 (completed type not selected properly with typeof)
PR c/20519
* c-decl.c (c_finish_incomplete_decl): Update complete_array_type call.
(build_compound_literal): Likewise. Propagate decl type into the
initializer.
(finish_decl): Likewise. Use new return value from complete_array_type
for zero sized arrays.
(complete_array_type): Move ...
* c-common.c (complete_array_type): ... here. Change first argument
to pointer-to-type-node. Consistently use sizetype for the index
except for zero sized arrays. Detect zero sized arrays for pedantic
mode diagnostics. Create a new type node instead of modifying the
old node in place.
* c-tree.h (complete_array_type): Move decl ...
* c-common.h (complete_array_type): ... here.
cp/
* decl.c (cp_complete_array_type): Rename from complete_array_type.
Use the new complete_array_type in c-common.c. Update all callers.
* cp-tree.h (cp_complete_array_type): Update to match.
From-SVN: r97223
Diffstat (limited to 'gcc/cp/typeck2.c')
-rw-r--r-- | gcc/cp/typeck2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 8017af3..daa2399 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -1123,7 +1123,7 @@ process_init_constructor (tree type, tree init, tree* elts) result = build_constructor (type, nreverse (members)); if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == NULL_TREE) - complete_array_type (type, result, /*do_default=*/0); + cp_complete_array_type (&TREE_TYPE (result), result, /*do_default=*/0); if (init) TREE_HAS_CONSTRUCTOR (result) = TREE_HAS_CONSTRUCTOR (init); if (allconstant) |