FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / conversion6.C
bloba8477e36864e6cd65eca7c0e571d08eeef87b6e8
1 // PRMS Id: g++/6034
3 extern "C" int printf (const char *, ...);
5 class Base
7         char x;
8 };
10 template <class T>
11 // remove the public Base inheritance and the problem goes away...
12 class Container : public Base
14 public:
16     Container(const T& aValue): myValue(aValue) { }
17     
18     operator const T&(void) const
19     {
20         printf("Container::const T& called\n");
21         return myValue;
22     }
23     
24 protected:
26     T myValue;
29 typedef unsigned short Type;
31 typedef Container<Type> TypeContainer;
33 int main(void)
35     TypeContainer myTypeContainer(2);
36     Type t = myTypeContainer;
38     printf ("myType = %d\n", t);
39     return t != 2;