OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [friend44.C] - Diff between revs 154 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 154 Rev 816
// { dg-do compile }
// { dg-do compile }
// Test that template friends referring to class template members are
// Test that template friends referring to class template members are
// respected.
// respected.
template  struct A
template  struct A
{
{
  int f (T);
  int f (T);
  struct AI {
  struct AI {
    int f (T);
    int f (T);
  };
  };
};
};
class B
class B
{
{
  template  friend int A::f (T);
  template  friend int A::f (T);
  template  friend struct A::AI;
  template  friend struct A::AI;
  int a;
  int a;
public:
public:
  B(): a(0) { }
  B(): a(0) { }
};
};
template  int A::f (T)
template  int A::f (T)
{
{
  B b;
  B b;
  return b.a;
  return b.a;
}
}
template  int A::AI::f (T)
template  int A::AI::f (T)
{
{
  B b;
  B b;
  return b.a;
  return b.a;
}
}
int main ()
int main ()
{
{
  A a;
  A a;
  A::AI ai;
  A::AI ai;
  int r = a.f (0);
  int r = a.f (0);
  r |= ai.f (0);
  r |= ai.f (0);
  return r;
  return r;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.