]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/18389 (ICE on struct declaration in for statement)
authorMark Mitchell <mark@codesourcery.com>
Fri, 12 Nov 2004 21:57:31 +0000 (21:57 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 12 Nov 2004 21:57:31 +0000 (21:57 +0000)
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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog

index 14f2584c33e3e86ca6f454bc3474762e8f382e65..ae4327db45ea3423d24370f78c433535975b60f1 100644 (file)
@@ -1,3 +1,17 @@
+2004-11-12  Mark Mitchell  <mark@codesourcery.com>
+
+       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.
index a19c501997bbc40ffaa56a38f1f28c015bbc9922..24a51d4b35a528e40b267216593c2ee93618c97a 100644 (file)
@@ -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);
 
index 6626871003bc5d622c041004f9a68b0635a8b9f0..4462b8599f0ae8ae87eb0fa23e36a135b744f62c 100644 (file)
@@ -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);
index 3ebbb772865d003c139e88eb4c93af641a64e0c6..6a27aa29cbf1b7d43174edc6b18063fbf9cb15b5 100644 (file)
@@ -1,3 +1,14 @@
+2004-11-12  Mark Mitchell  <mark@codesourcery.com>
+
+       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  <ebotcazou@act-europe.fr>
 
        * gcc.c-torture/execute/20041112-1.c: New test.