Commit a5dccd46 by Nathan Sidwell Committed by Nathan Sidwell

[PR c++/84694] ICE on template friend decl

https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00221.html
	PR c++/84694
	* friend.c (do_friend): Restore check for identifier_p inside
	TEMPLATE_ID_EXPR.

	PR c++/84694
	* g++.dg/template/pr84694.C: New.

From-SVN: r258254
parent 8c6b5eb8
2018-03-05 Nathan Sidwell <nathan@acm.org>
PR c++/84694
* friend.c (do_friend): Restore check for identifier_p inside
TEMPLATE_ID_EXPR.
2018-03-05 Paolo Carlini <paolo.carlini@oracle.com> 2018-03-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84618 PR c++/84618
......
...@@ -495,7 +495,8 @@ do_friend (tree ctype, tree declarator, tree decl, ...@@ -495,7 +495,8 @@ do_friend (tree ctype, tree declarator, tree decl,
if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR) if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR)
{ {
declarator = TREE_OPERAND (declarator, 0); declarator = TREE_OPERAND (declarator, 0);
declarator = OVL_NAME (declarator); if (!identifier_p (declarator))
declarator = OVL_NAME (declarator);
} }
if (ctype) if (ctype)
......
2018-03-05 Nathan Sidwell <nathan@acm.org>
PR c++/84694
* g++.dg/template/pr84694.C: New.
2018-03-05 Jakub Jelinek <jakub@redhat.com> 2018-03-05 Jakub Jelinek <jakub@redhat.com>
PR target/84524 PR target/84524
......
// PR c++84694 ICE on friend decl
template<typename>
struct a {
template<int ()> void b();
friend void b<0>(); // ICEd with useless friend decl
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment