diff options
author | Nathan Sidwell <nathan@acm.org> | 2018-03-05 16:12:07 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-03-05 16:12:07 +0000 |
commit | a5dccd4614b84381f6799ae0162cd0859de0fc86 (patch) | |
tree | 03af6f3f0445e065205df84e609d661b9592fa55 /gcc/cp | |
parent | 8c6b5eb80f51aa685b1d86305399d4dc22300ec2 (diff) | |
download | gcc-a5dccd4614b84381f6799ae0162cd0859de0fc86.zip gcc-a5dccd4614b84381f6799ae0162cd0859de0fc86.tar.gz gcc-a5dccd4614b84381f6799ae0162cd0859de0fc86.tar.bz2 |
[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
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/friend.c | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5e16635..6c37dc3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +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> PR c++/84618 diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 8125f1c..b31d4cf 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -495,7 +495,8 @@ do_friend (tree ctype, tree declarator, tree decl, if (TREE_CODE (declarator) == TEMPLATE_ID_EXPR) { declarator = TREE_OPERAND (declarator, 0); - declarator = OVL_NAME (declarator); + if (!identifier_p (declarator)) + declarator = OVL_NAME (declarator); } if (ctype) |