diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2020-02-25 21:29:03 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-02-25 23:21:14 -0500 |
commit | 3d99aab56d7237bb8260653ed07ca8b182fbf975 (patch) | |
tree | f3ebf8fc190d7a6d9877f0238982b0b27677d0d0 /gcc/cp/ChangeLog | |
parent | 6470e8caa2bd331fb6e21524d6c14662531cfa9b (diff) | |
download | gcc-3d99aab56d7237bb8260653ed07ca8b182fbf975.zip gcc-3d99aab56d7237bb8260653ed07ca8b182fbf975.tar.gz gcc-3d99aab56d7237bb8260653ed07ca8b182fbf975.tar.bz2 |
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 <aoliva@redhat.com>
PR c++/86747
* pt.c (tsubst_friend_class): Enter tsubsted class context.
gcc/testsuite/ChangeLog
2020-02-25 Alexandre Oliva <aoliva@redhat.com>
PR c++/86747
* g++.dg/pr86747.C: New.
Diffstat (limited to 'gcc/cp/ChangeLog')
-rw-r--r-- | gcc/cp/ChangeLog | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eecfc71..f070889 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2020-02-25 Alexandre Oliva <aoliva@redhat.com> + + PR c++/86747 + * pt.c (tsubst_friend_class): Enter tsubsted class context. + 2020-02-25 Jason Merrill <jason@redhat.com> PR c++/86429 - constexpr variable in lambda. |