mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 16:00:58 +08:00
re PR c++/87571 (ICE in friend_accessible_p, accessing protected member of template friend inside template class)
2019-03-11 Paolo Carlini <paolo.carlini@oracle.com> PR c++/87571 * g++.dg/template/memfriend18.C: New. From-SVN: r269575
This commit is contained in:
parent
6068721c55
commit
470fa18b8d
@ -1,3 +1,8 @@
|
||||
2019-03-11 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/87571
|
||||
* g++.dg/template/memfriend18.C: New.
|
||||
|
||||
2019-03-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||
|
||||
* gdc.dg/pr89041.d: Mark as compile test.
|
||||
|
19
gcc/testsuite/g++.dg/template/memfriend18.C
Normal file
19
gcc/testsuite/g++.dg/template/memfriend18.C
Normal file
@ -0,0 +1,19 @@
|
||||
// PR c++/87571
|
||||
|
||||
template <class> struct A {
|
||||
template <class> struct B {
|
||||
template <class> friend class B;
|
||||
protected:
|
||||
int protected_member_;
|
||||
public:
|
||||
template <class T> int method(const B<T>& other) const {
|
||||
return other.protected_member_;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
int main() {
|
||||
A<int>::B<int> a;
|
||||
A<int>::B<char> b;
|
||||
a.method(b);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user