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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [conversion6.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// PRMS Id: g++/6034
3
 
4
extern "C" int printf (const char *, ...);
5
 
6
class Base
7
{
8
        char x;
9
};
10
 
11
template 
12
// remove the public Base inheritance and the problem goes away...
13
class Container : public Base
14
{
15
public:
16
 
17
    Container(const T& aValue): myValue(aValue) { }
18
 
19
    operator const T&(void) const
20
    {
21
        printf("Container::const T& called\n");
22
        return myValue;
23
    }
24
 
25
protected:
26
 
27
    T myValue;
28
};
29
 
30
typedef unsigned short Type;
31
 
32
typedef Container TypeContainer;
33
 
34
int main(void)
35
{
36
    TypeContainer myTypeContainer(2);
37
    Type t = myTypeContainer;
38
 
39
    printf ("myType = %d\n", t);
40
    return t != 2;
41
}

powered by: WebSVN 2.1.0

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