[Bug c++/61327] Problem with friend template object

2019-04-04 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61327

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Paolo Carlini  ---
Done.

[Bug c++/61327] Problem with friend template object

2019-04-04 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61327

--- Comment #4 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Thu Apr  4 15:38:05 2019
New Revision: 270145

URL: https://gcc.gnu.org/viewcvs?rev=270145&root=gcc&view=rev
Log:
2019-04-04  Paolo Carlini  

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

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/friend4.C
trunk/gcc/testsuite/g++.dg/cpp0x/friend5.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/61327] Problem with friend template object

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

--- Comment #3 from Jonathan Wakely  ---
Fixed for GCC 6 by r227023, which fixed PR 66957.

The examples here look different enough that we should probably add them to the
testsuite before closing this.

[Bug c++/61327] Problem with friend template object

2014-05-27 Thread isak50 at mail dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61327

--- Comment #2 from Pavel  ---
// Clang compiles without errors.
class B {
protected:
  void f() {}
};

template 
struct S;

template 
struct S{
template 
static void caller(T *p) {p->B::f();}   // error: 'void B::f()' is
protected
//static void caller(T *p) {p->f();}// Ok
};

class Q : B{
template  friend struct S;
};

int main(){
Q q;
S::caller(&q);
return 0;
}


[Bug c++/61327] Problem with friend template object

2014-05-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61327

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-05-27
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
Reduced:

template
struct A;

template
struct A
{
  template
  void f(U* u) {
u->T::g();
  }
};

struct B {
protected:
  void g() { }
};

struct C : B {
  template friend struct A;
};

int main()
{
  C c;
  A a;
  a.f(&c);
}

The partial specialization does not match the friend declaration for some
reason, I think it should do.