aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-02-23 05:30:48 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-02-23 05:30:48 +0000
commit744b12b65f6923a713593f404f97384c6093dd94 (patch)
treeb003a007ec3edf4d8323134ca4e5d3a88c20f95d /gcc/cp/decl2.c
parent90c1d75a9bb8e25aa963da02f9c91f5f40143be1 (diff)
downloadgcc-744b12b65f6923a713593f404f97384c6093dd94.zip
gcc-744b12b65f6923a713593f404f97384c6093dd94.tar.gz
gcc-744b12b65f6923a713593f404f97384c6093dd94.tar.bz2
re PR c++/19991 (Enum not accepted in array-size)
PR c++/19991 * init.c (integral_constant_value): Iterate if the value of a decl is itself a constant. PR c++/20152 * parser.c (cp_parser_class_head): Check for redefintions here. * semantics.c (begin_class_definition): Not here. PR c++/20153 * decl2.c (build_anon_union_vars): Add type parameter. (finish_anon_union): Pass it. PR c++/20148 * error.c (dump_expr): Do not print the body of a BIND_EXPR. Handle STATEMENT_LIST. PR c++/19991 * g++.dg/parse/constant7.C: New test. PR c++/20152 * g++.dg/parse/error27.C: New test. * g++.dg/template/qualttp15.C: Adjust error markers. * g++.old-deja/g++.other/struct1.C: Likewise. PR c++/20153 * g++.dg/template/error17.C: New test. PR c++/20148 * g++.dg/parser/error26.C: New test. From-SVN: r95438
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8243cb1..7ed490e 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -65,7 +65,6 @@ typedef struct priority_info_s {
static void mark_vtable_entries (tree);
static bool maybe_emit_vtables (tree);
-static tree build_anon_union_vars (tree);
static bool acceptable_java_type (tree);
static tree start_objects (int, int);
static void finish_objects (int, int, tree);
@@ -1072,14 +1071,13 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags)
SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (*decl), TREE_TYPE (*decl));
}
-/* Walks through the namespace- or function-scope anonymous union OBJECT,
- building appropriate ALIAS_DECLs. Returns one of the fields for use in
- the mangled name. */
+/* Walks through the namespace- or function-scope anonymous union
+ OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs.
+ Returns one of the fields for use in the mangled name. */
static tree
-build_anon_union_vars (tree object)
+build_anon_union_vars (tree type, tree object)
{
- tree type = TREE_TYPE (object);
tree main_decl = NULL_TREE;
tree field;
@@ -1127,7 +1125,7 @@ build_anon_union_vars (tree object)
decl = pushdecl (decl);
}
else if (ANON_AGGR_TYPE_P (TREE_TYPE (field)))
- decl = build_anon_union_vars (ref);
+ decl = build_anon_union_vars (TREE_TYPE (field), ref);
else
decl = 0;
@@ -1167,7 +1165,7 @@ finish_anon_union (tree anon_union_decl)
return;
}
- main_decl = build_anon_union_vars (anon_union_decl);
+ main_decl = build_anon_union_vars (type, anon_union_decl);
if (main_decl == NULL_TREE)
{
warning ("anonymous union with no members");