diff options
author | Nathan Sidwell <nathan@acm.org> | 2018-06-20 19:22:53 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2018-06-20 19:22:53 +0000 |
commit | c1456656842bef093d73e1f324eb49b94db87203 (patch) | |
tree | 9a2a4b42351f389b6e96a0153aa538ec4ab09047 /gcc/cp | |
parent | f2cb6e64c920bb2f4e8a1ce9cb300385b53349ed (diff) | |
download | gcc-c1456656842bef093d73e1f324eb49b94db87203.zip gcc-c1456656842bef093d73e1f324eb49b94db87203.tar.gz gcc-c1456656842bef093d73e1f324eb49b94db87203.tar.bz2 |
[PR c++/85634] Fix tsubst ICE
https://gcc.gnu.org/ml/gcc-patches/2018-06/msg01274.html
PR c++/85634
* friend.c (add_friend): Keep lookup sets of tempate sets.
PR c++/85634
* g++.dg/lookup/pr85634-2.C: New.
From-SVN: r261817
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/friend.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b567d60..8dabe76 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2018-06-20 Nathan Sidwell <nathan@acm.org> + + PR c++/85634 + * friend.c (add_friend): Keep lookup sets of tempate sets. + 2018-06-20 Paolo Carlini <paolo.carlini@oracle.com> * decl.c (grokfndecl): Add const cp_decl_specifier_seq* parameter; diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index b31d4cf..2c9c12f 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -173,6 +173,12 @@ add_friend (tree type, tree decl, bool complain) if (decl == error_mark_node) return; + if (TREE_CODE (decl) == FUNCTION_DECL + && DECL_TEMPLATE_INSTANTIATION (decl)) + /* We'll have parsed this as a declaration, and therefore not + marked the lookup set for keeping. Do that now. */ + lookup_keep (DECL_TI_TEMPLATE (decl)); + typedecl = TYPE_MAIN_DECL (type); list = DECL_FRIENDLIST (typedecl); name = DECL_NAME (decl); |