/cp
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Aug 2007 22:13:45 +0000 (22:13 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 14 Aug 2007 22:13:45 +0000 (22:13 +0000)
2007-08-14  Paolo Carlini  <pcarlini@suse.de>

PR c++/27211
* decl2.c (check_classfn): Return error_mark_node in case of error;
in that case, do not call add_method.
* decl.c (start_decl): Deal with check_classfn returning
error_mark_node.
(grokfndecl): Likewise.
* pt.c (tsubst_friend_function): Likewise.

/testsuite
2007-08-14  Paolo Carlini  <pcarlini@suse.de>

PR c++/27211
* g++.dg/template/error27.C: New.
* g++.dg/template/error28.C: New.
* g++.dg/other/pr28304.C: Adjust.
* g++.old-deja/g++.mike/p811.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127493 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/pt.c

index e4f56d8..5a0bd71 100644 (file)
@@ -6287,7 +6287,7 @@ tsubst_friend_function (tree decl, tree args)
          tree fn = check_classfn (context,
                                   new_friend, NULL_TREE);
 
-         if (fn)
+         if (fn && fn != error_mark_node)
            new_friend = fn;
        }
     }