From: Mark Mitchell Date: Fri, 12 Nov 2004 21:57:31 +0000 (+0000) Subject: re PR c++/18389 (ICE on struct declaration in for statement) X-Git-Tag: releases/gcc-3.4.4~520 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c3ca8fa5973708e34a4b377f81b7c070d4f3329;p=thirdparty%2Fgcc.git re PR c++/18389 (ICE on struct declaration in for statement) PR c++/18389 * decl.c (start_decl): Make sure to set *pop_scope_p. Return error_mark_node to indicate errors. PR c++/18436 * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an unqualified name resolves to a member function. PR c++/18407 * pt.c (tsubst_copy_and_build): Handle qualified names used from a derived class correctly. * decl2.c (import_export_decl): Fix typo in comment. * tree.c (pod_type_p): Likewise. PR c++/18389 * g++.dg/parse/cond1.C: New test. PR c++/18436 * g++.dg/template/call3.C: New test. PR c++/18407 * g++.dg/template/ptrmem11.C: New test. From-SVN: r90547 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 14f2584c33e3..ae4327db45ea 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2004-11-12 Mark Mitchell + + PR c++/18389 + * decl.c (start_decl): Make sure to set *pop_scope_p. Return + error_mark_node to indicate errors. + + PR c++/18436 + * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an + unqualified name resolves to a member function. + + PR c++/18407 + * pt.c (tsubst_copy_and_build): Handle qualified names used from a + derived class correctly. + 2004-11-04 Release Manager * GCC 3.4.3 released. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a19c501997bb..24a51d4b35a5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -3704,12 +3704,12 @@ start_decl (tree declarator, deprecated_state = DEPRECATED_NORMAL; if (decl == NULL_TREE || TREE_CODE (decl) == VOID_TYPE) - return NULL_TREE; + return error_mark_node; type = TREE_TYPE (decl); if (type == error_mark_node) - return NULL_TREE; + return error_mark_node; context = DECL_CONTEXT (decl); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 6626871003bc..4462b8599f0a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8454,7 +8454,11 @@ tsubst_copy_and_build (tree t, lookup finds a non-function, in accordance with the expected resolution of DR 218. */ if (koenig_p - && (is_overloaded_fn (function) + && ((is_overloaded_fn (function) + /* If lookup found a member function, the Koenig lookup is + not appropriate, even if an unqualified-name was used + to denote the function. */ + && !DECL_FUNCTION_MEMBER_P (get_first_fn (function))) || TREE_CODE (function) == IDENTIFIER_NODE)) function = perform_koenig_lookup (function, call_args); @@ -8570,9 +8574,14 @@ tsubst_copy_and_build (tree t, /*is_type_p=*/false, /*complain=*/false); if (BASELINK_P (member)) - BASELINK_FUNCTIONS (member) - = build_nt (TEMPLATE_ID_EXPR, BASELINK_FUNCTIONS (member), - args); + { + BASELINK_FUNCTIONS (member) + = build_nt (TEMPLATE_ID_EXPR, BASELINK_FUNCTIONS (member), + args); + member = (adjust_result_of_qualified_name_lookup + (member, BINFO_TYPE (BASELINK_BINFO (member)), + TREE_TYPE (object))); + } else { qualified_name_lookup_error (TREE_TYPE (object), tmpl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3ebbb772865d..6a27aa29cbf1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2004-11-12 Mark Mitchell + + PR c++/18389 + * g++.dg/parse/cond1.C: New test. + + PR c++/18436 + * g++.dg/template/call3.C: New test. + + PR c++/18407 + * g++.dg/template/ptrmem11.C: New test. + 2004-11-12 Eric Botcazou * gcc.c-torture/execute/20041112-1.c: New test.