Jump to page: 1 2
Thread overview
Scott Meyers Test
Jul 25, 2002
Mark Evans
Jul 25, 2002
Cesar Rabak
Jul 25, 2002
Mark Evans
Jul 25, 2002
Walter
Jul 26, 2002
Mark Evans
Jul 26, 2002
Walter
Jul 29, 2002
Mark Evans
Jul 30, 2002
Heinz Saathoff
Jul 26, 2002
Cesar Rabak
Jul 26, 2002
Mark Evans
Jul 26, 2002
Mark Evans
July 25, 2002
Scott Meyers, author of "Effective STL," wonders whether DMC can compile this very small program.  -M.

const class {
public:
template <class T>
operator T*() const {return 0;}

template <class C, class T>
operator T C::*() const {return 0;}

} null = {};

class A {
public:
int  f (char, int);
int  f (char, double);
void f (const char *) const;
};

class B {};

int main() {
int (A::*pmf)(char, int) = &A::f;
pmf = null;
int (A::*pmf2)(char, double) = &A::f;
pmf2 = null;
void (A::*pmf3)(const char*) const = &A::f;
pmf3 = null;

void (B::*pmf4)() const = null;
}


July 25, 2002
Mark Evans wrote:
> 
> Scott Meyers, author of "Effective STL," wonders whether DMC can compile this very small program.  -M.
> 
[snipped]

Just wondering: can't Mr. Meyers check this by himself?

-- 
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/
July 25, 2002
I enticed the guy maintaining Meyer's Effective STL code to start using DMC in his test suites.

Meyers sent this test case to me, and I thought that if any bugs resulted from it, then they should be public.  I also thought that Walter might just glance at it and say "no that's not supported yet" or "yes it should work" or "yes it does work."

I just tried it with the latest beta release and got errors as follows.  I did
not use any compiler flags.
M.

==========================
C:\dm\bin>scppn e:\test\meyerstest.cpp
} null = {};
^
e:\test\meyerstest.cpp(9) : Error: malformed template declaration
pmf = null;
^
e:\test\meyerstest.cpp(22) : Error: undefined identifier 'null'
pmf2 = null;
^
e:\test\meyerstest.cpp(24) : Error: need explicit cast to convert
from: int
to  : int ( A::*member func)(char ,double )
pmf3 = null;
^
e:\test\meyerstest.cpp(26) : Error: need explicit cast to convert
from: int
to  : void ( A::*member func)(char const *)const
void (B::*pmf4)() const = null;
^
e:\test\meyerstest.cpp(28) : Error: need explicit cast to convert
Fatal error: too many errors



July 25, 2002
Yes, it doesn't work at the moment. I don't know how much work it would be to fix it. -Walter

"Mark Evans" <Mark_member@pathlink.com> wrote in message news:ahpshu$j42$1@digitaldaemon.com...
> I enticed the guy maintaining Meyer's Effective STL code to start using
DMC in
> his test suites.
>
> Meyers sent this test case to me, and I thought that if any bugs resulted
from
> it, then they should be public.  I also thought that Walter might just
glance at
> it and say "no that's not supported yet" or "yes it should work" or "yes
it does
> work."
>
> I just tried it with the latest beta release and got errors as follows.  I
did
> not use any compiler flags.
> M.



July 26, 2002
Mark Evans wrote:
> 
> I enticed the guy maintaining Meyer's Effective STL code to start using DMC in his test suites.

I see. Is the code supposed to be inherently compiler agnostic or are there #ifdefs here and there to support several compilers?


-- 
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/
July 26, 2002
Microsoft Visual C++ 6 Service Pack 5 also bombs on this test case.

M.

--------------------Configuration: MeyersTest - Win32 Debug--------------------
Compiling...
MeyersTest.cpp
e:\test\meyerstest.cpp(9) : error C2059: syntax error : '}'
e:\test\meyerstest.cpp(9) : error C2143: syntax error : missing ';' before '}'
e:\test\meyerstest.cpp(9) : error C2143: syntax error : missing ';' before '}'
e:\test\meyerstest.cpp(22) : error C2440: '=' : cannot convert from 'const class
' to 'int (__thiscall A::*)(char,int)'
No user-defined-conversion operator available that can perform this conversion,
or the operator cannot be called
e:\test\meyerstest.cpp(24) : error C2440: '=' : cannot convert from 'const class
' to 'int (__thiscall A::*)(char,double)'
No user-defined-conversion operator available that can perform this conversion,
or the operator cannot be called
e:\test\meyerstest.cpp(26) : error C2440: '=' : cannot convert from 'const class
' to 'void (__thiscall A::*)(const char *) const'
No user-defined-conversion operator available that can perform this conversion,
or the operator cannot be called
e:\test\meyerstest.cpp(28) : error C2440: 'initializing' : cannot convert from
'const class ' to 'void (__thiscall B::*)(void) const'
No user-defined-conversion operator available that can perform this conversion,
or the operator cannot be called
e:\test\meyerstest.cpp(29) : warning C4508: 'main' : function should return a
value; 'void' return type assumed
Error executing cl.exe.

MeyersTest.obj - 7 error(s), 1 warning(s)


July 26, 2002
It's just one of Scott Meyer's pet test programs -- what he calls a "standard" program meaning that anything claiming to handle C++ should handle it without modification.

He says that Borland and Comeau handle this particular case, and my reply was:

"But I can practically guarantee that there exists, in the space of all possible C++ programs, cases which DMC compiles that those two do not.

Still you are right Borland and Comeau are good."

Mark


July 26, 2002
(Those STL gurus were also confused about <iostream> support in DMC and that was another mark against it in their minds.  -M.)


July 26, 2002
"Mark Evans" <Mark_member@pathlink.com> wrote in message news:ahq3mi$qqv$1@digitaldaemon.com...
> Microsoft Visual C++ 6 Service Pack 5 also bombs on this test case.

Must be one of those compiler torture tests <g>.


July 29, 2002
Walter just advised me that the latest beta 8.29.19 successfully compiles the code.

And it only took Walter a couple days to fix.  That must be some really good C++ compiler code.

Thank you Walter for your usual prompt action.

-M.


« First   ‹ Prev
1 2