re PR c++/26739 (ICE in g++.old-deja/g++.pt/friend36.C)

PR c++/26739
	* pt.c (tsubst_friend_function): Return early if
	pushdecl_namespace_level fails.

	* g++.old-deja/g++.pt/friend36.C: Adjust error markers.

From-SVN: r113090
This commit is contained in:
Volker Reichelt 2006-04-19 18:07:19 +00:00 committed by Volker Reichelt
parent b815a6316c
commit 0014c2479a
4 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/26739
* pt.c (tsubst_friend_function): Return early if
pushdecl_namespace_level fails.
PR c++/26036
* typeck.c (convert_arguments): Return error_mark_node instead of
error_mark_list.

View File

@ -5230,6 +5230,9 @@ tsubst_friend_function (tree decl, tree args)
old_decl = pushdecl_namespace_level (new_friend, /*is_friend=*/true);
pop_nested_namespace (ns);
if (old_decl == error_mark_node)
return error_mark_node;
if (old_decl != new_friend)
{
/* This new friend declaration matched an existing

View File

@ -1,5 +1,8 @@
2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/26739
* g++.old-deja/g++.pt/friend36.C: Adjust error markers.
PR c++/26036
* g++.dg/expr/call3.C: New test.

View File

@ -1,12 +1,12 @@
// { dg-do assemble }
template <class T>
void f(T) {} // { dg-error "" } previously defined here
void f(T) {} // { dg-error "previously" }
template <class U>
struct S {
template <class T>
friend void f(T) {} // { dg-error "" } redeclaration
friend void f(T) {} // { dg-error "redefinition" }
};
S<int> si;