Commit a7f70a09 by Paolo Carlini Committed by Paolo Carlini

re PR c++/61327 (Problem with friend template object)

2019-04-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/61327
	* g++.dg/cpp0x/friend4.C: New.
	* g++.dg/cpp0x/friend5.C: Likewise.

From-SVN: r270145
parent 7b74bfb1
2019-04-04 Paolo Carlini <paolo.carlini@oracle.com> 2019-04-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/61327
* g++.dg/cpp0x/friend4.C: New.
* g++.dg/cpp0x/friend5.C: Likewise.
2019-04-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56643 PR c++/56643
* g++.dg/cpp0x/noexcept40.C: New. * g++.dg/cpp0x/noexcept40.C: New.
......
// PR c++/61327
// { dg-do compile { target c++11 } }
template<typename... T>
struct A;
template<typename T>
struct A<T>
{
template<typename U>
void f(U* u) {
u->T::g();
}
};
struct B {
protected:
void g() { }
};
struct C : B {
template<typename...> friend struct A;
};
int main()
{
C c;
A<B> a;
a.f(&c);
}
// PR c++/61327
// { dg-do compile { target c++11 } }
class B {
protected:
void f() {}
};
template <typename...>
struct S;
template <typename R>
struct S<R>{
template <typename T>
static void caller(T *p) {p->B::f();}
};
class Q : B{
template <typename...> friend struct S;
};
int main(){
Q q;
S<int>::caller(&q);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment