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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [friend31.C] - Blame information for rev 696

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
// Origin: Ivan Godard 
4
 
5
// PR c++/15410: Declaration of friend class template with wrong
6
// template parameter.
7
 
8
template  struct F; // { dg-message "previous declaration" }
9
 
10
class W
11
{
12
  template friend class F;      // { dg-error "template parameter" }
13
  int x;                                // { dg-error "private" }
14
};
15
 
16
template  struct F
17
{
18
  void Look(W& w) { w.x = 3; }          // { dg-error "within this context" }
19
};
20
 
21
int main()
22
{
23
  W w;
24
  F f;
25
  f.Look(w);
26
  return 0;
27
}

powered by: WebSVN 2.1.0

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