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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [other/] [friend2.C] - Blame information for rev 308

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

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do run }
2
// Origin: Volker Reichelt  
3
 
4
// PR c++/12370
5
// Wrong code because of the friend declaration
6
 
7
template  struct A
8
{
9
    T x;
10
    A(T t) : x(t) {}
11
    friend A foo (const A&);
12
};
13
 
14
A foo (const A& a)
15
{
16
    A res(a.x);
17
    return res;
18
}
19
 
20
int main()
21
{
22
    return foo(A(0)).x;
23
}

powered by: WebSVN 2.1.0

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