January 19, 2004 Bug in dmd | ||||
|---|---|---|---|---|
  | ||||
I tried to compile the following code (I just wanted to experiment a bit with the new template-abilitys, but I get the following:
Assertion failure: '0' on line 67 in file 'template.c'
abnormal program termination
The code is:
/* C++
template <typename T>
struct Foo {
typedef T Type;
template <typename U>
struct Inner {
typedef U Type;
};
};
template <template <typename> class TT>
struct Bar {
typedef typename TT<int>::Type A;
typedef typename TT<int>::template Inner<A>::Type B;
};
int main(int argc, char *argv[])
{
Bar<Foo>::A x;
Bar<Foo>::B y;
}
*/
class Foo (T) {
typedef T Type;
class Inner (U) {
typedef U Type;
};
};
struct Bar (alias TT) {
typedef TT!(int).Type A;
typedef TT!(int).Inner!(A).Type B;
};
int main (char [][] args)
{
Bar!(Foo).A x;
Bar!(Foo).B y;
return 0;
}
 | ||||
January 21, 2004 Re: Bug in dmd | ||||
|---|---|---|---|---|
  | ||||
Posted in reply to Matthias Becker  | WTF!!?!! Is that even legit C++ code?!! I have never seen such a thing. I'm going to have to try that. VC++ 7.0 doesn't seem to like it. Sean "Matthias Becker" <Matthias_member@pathlink.com> wrote in message news:buh7uu$28mh$1@digitaldaemon.com... > I tried to compile the following code (I just wanted to experiment a bit with > the new template-abilitys, but I get the following: > > Assertion failure: '0' on line 67 in file 'template.c' > > abnormal program termination > > > The code is: > > /* C++ > > template <typename T> > struct Foo { > typedef T Type; > > template <typename U> > struct Inner { > typedef U Type; > }; > }; > > template <template <typename> class TT> > struct Bar { > typedef typename TT<int>::Type A; > typedef typename TT<int>::template Inner<A>::Type B; > }; > > int main(int argc, char *argv[]) > { > Bar<Foo>::A x; > Bar<Foo>::B y; > } > > */ > > class Foo (T) { > typedef T Type; > > class Inner (U) { > typedef U Type; > }; > }; > > struct Bar (alias TT) { > typedef TT!(int).Type A; > typedef TT!(int).Inner!(A).Type B; > > }; > > int main (char [][] args) > { > Bar!(Foo).A x; > Bar!(Foo).B y; > > return 0; > }  | |||
Copyright © 1999-2021 by the D Language Foundation
 
Permalink
Reply