www.digitalmars.com         C & C++   DMDScript  

c++ - C++ 8.29.17 beta bug report

reply Christof Meerwald <cmeerw web.de> writes:
here is one more:

template<class T>
struct A
{
  A()
  { }

  A(const A<T> &a)
  { }

  template<class U>
  A(const A<U> &a)
  // Error: 'A<char >::A<char >' is already defined
  { }
};


template <class U, class V>
class P
  : public V
{
 public:
  P(const V &v)
    : V(v)
  { }
};


template<class T, class U>
struct B
{
 public:
  U g()
  { return U(P<T, U>(U())); }
};


int main()
{
  B<char, A<char> > b;
  b.g();

  return 0;
}


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Jul 26 2002
parent Christof Meerwald <cmeerw web.de> writes:
I guess this one shouldn't compile, but it currently does:

struct A
{
  static const int c = 42;

  struct B
  { };
};


int main(int argc)
{
  return A::B::c;
}


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Jul 26 2002