www.digitalmars.com         C & C++   DMDScript  

c++.beta - [8.50.1n] a bug

reply "Pavel Vozenilek" <pavel_vozenilek yahoo.co.uk> writes:
Snippet bellow fails in 8.50.1n. It is part of STLport as shipped with DMC.
Was present in 8.49.2n. Comeau compiles it.

------------code------------

struct __true_type {};
struct __false_type {};


template <int _Is>
struct __bool2type
{
  typedef __false_type _Ret;
};

template<>
struct __bool2type<1> { typedef __true_type _Ret; };

template<>
struct __bool2type<0> { typedef __false_type _Ret; };


int main() {}

----end code--------------


with

C:\dm\bin>dmc a.cc
template <int _Is>
         ^
a.cc(5) : Error: '=', ';' or ',' expected
};
^
a.cc(9) : Error: identifier or '( declarator )' expected
template<>
         ^
a.cc(11) : Error: '=', ';' or ',' expected
struct __bool2type<1> { typedef __true_type _Ret; };
                                                  ^
a.cc(12) : Error: identifier or '( declarator )' expected
template<>
         ^
a.cc(14) : Error: '=', ';' or ',' expected
Fatal error: too many errors
--- errorlevel 1


/Pavel
Nov 25 2006
parent reply Walter Bright <newshound digitalmars.com> writes:
Pavel Vozenilek wrote:
 Snippet bellow fails in 8.50.1n. It is part of STLport as shipped with DMC.
 Was present in 8.49.2n. Comeau compiles it.

DMC++ will, too, if you use the -cpp switch <g>.
Nov 26 2006
parent reply "Pavel Vozenilek" <pavel_vozenilek yahoo.co.uk> writes:
"Walter Bright" wrote:
 Pavel Vozenilek wrote:
 Snippet bellow fails in 8.50.1n. It is part of STLport as shipped with 
 DMC.
 Was present in 8.49.2n. Comeau compiles it.

DMC++ will, too, if you use the -cpp switch <g>.

Oops, I used extension .cc as I am do a project which has such a convention. /Pavel
Nov 27 2006
parent "Matthew" <matthew hat.stlsoft.dot.org> writes:
It'd be nice if in sn.ini one could specify the C and C++ language
extensions.

"Pavel Vozenilek" <pavel_vozenilek yahoo.co.uk> wrote in message
news:ekeevu$2m1e$1 digitaldaemon.com...
 "Walter Bright" wrote:
 Pavel Vozenilek wrote:
 Snippet bellow fails in 8.50.1n. It is part of STLport as shipped with
 DMC.
 Was present in 8.49.2n. Comeau compiles it.

DMC++ will, too, if you use the -cpp switch <g>.

Oops, I used extension .cc as I am do a project which has such a

 /Pavel

Nov 27 2006