From: Volker Reichelt Date: Thu, 1 Sep 2005 11:47:42 +0000 (+0000) Subject: Backport: X-Git-Tag: releases/gcc-3.4.5~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=549c63bd174b80cac8e0620eda63176f2e381931;p=thirdparty%2Fgcc.git Backport: 2005-02-22 Mark Mitchell PR c++/20153 * decl2.c (build_anon_union_vars): Add type parameter. (finish_anon_union): Pass it. * g++.dg/template/error17.C: New test. 2005-07-28 Mark Mitchell PR c++/22545 * call.c (add_builtin_candidate): Adjust for changes in representation of pointer-to-member types. * g++.dg/expr/ptrmem7.C: New test. From-SVN: r103725 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b054e31a7e6c..e24c72bddd4b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2005-09-01 Volker Reichelt + + Backport: + + 2005-02-22 Mark Mitchell + PR c++/20153 + * decl2.c (build_anon_union_vars): Add type parameter. + (finish_anon_union): Pass it. + + 2005-07-28 Mark Mitchell + PR c++/22545 + * call.c (add_builtin_candidate): Adjust for changes in + representation of pointer-to-member types. + 2005-09-01 Volker Reichelt PR c++/13377 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 404c2ad12318..067b0450c454 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1556,7 +1556,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1) && (TYPE_PTRMEMFUNC_P (type2) - || is_complete (TREE_TYPE (TREE_TYPE (type2))))) + || is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2)))) break; } return; diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 09fe5ddea079..0a7155ed470f 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -64,7 +64,6 @@ typedef struct priority_info_s { static void mark_vtable_entries (tree); static void grok_function_init (tree, 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); @@ -1131,14 +1130,13 @@ defer_fn (tree fn) VARRAY_PUSH_TREE (deferred_fns, fn); } -/* 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; @@ -1185,7 +1183,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; @@ -1225,7 +1223,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"); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 81e6c9a0c439..e4356b2faa96 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2005-09-01 Volker Reichelt + + Backport: + + 2005-02-22 Mark Mitchell + PR c++/20153 + * g++.dg/template/error17.C: New test. + + 2005-07-28 Mark Mitchell + PR c++/22545 + * g++.dg/expr/ptrmem7.C: New test. + 2005-09-01 Volker Reichelt PR c++/13377