[Bug c++/86747] [8 Regression] rejects-valid with redundant friend declaration

2020-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86747

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 CC||jason at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #10 from Jason Merrill  ---
Fixed for 8.4.

[Bug c++/86747] [8 Regression] rejects-valid with redundant friend declaration

2020-02-25 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86747

--- Comment #9 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:3d99aab56d7237bb8260653ed07ca8b182fbf975

commit r8-10073-g3d99aab56d7237bb8260653ed07ca8b182fbf975
Author: Alexandre Oliva 
Date:   Tue Feb 25 21:29:03 2020 -0500

c++: tsubst friend tpl ctxt before looking it up for dupes [PR86747]

When a member template is redeclared as a friend, we enter the context
of the member before looking it up, and then we check that the decls
are compatible.  However, when the member template references template
types of the enclosing context, say an enclosing template class, the
compare fails because the friend decl is already tsubsted, whereas the
looked up name isn't.

The problem is that the enclosing context is taken from the friend
declaration before tsubsting it, so we look up in the context of the
generic template instead of that of the tsubsted one we're
specializing.  The solution is to tsubst the enclosing context when
it's a non-namespace scope.

gcc/cp/ChangeLog
2020-02-25  Alexandre Oliva 

PR c++/86747
* pt.c (tsubst_friend_class): Enter tsubsted class context.

gcc/testsuite/ChangeLog
2020-02-25  Alexandre Oliva 

PR c++/86747
* g++.dg/pr86747.C: New.

[Bug c++/86747] [8 Regression] rejects-valid with redundant friend declaration

2019-02-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86747

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|8.3 |8.4

--- Comment #8 from Jakub Jelinek  ---
GCC 8.3 has been released.

[Bug c++/86747] [8 Regression] rejects-valid with redundant friend declaration

2019-01-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86747

--- Comment #7 from Jonathan Wakely  ---
This patch also fixed PR 87651 and PR 87652 which are also regressions on
gcc-8-branch.