msvc patches for khtml/kjs

Peter Kümmel syntheticpp at gmx.net
Fri Feb 10 15:11:44 CET 2006


>
> What's the problem with the template function/the error that you get, and what
> MSVC version are you building with?
>
>

Hi Maks,

the error message is

C:\sandbox\kdelibs\kdelibs\khtml\ecma\kjs_html.cpp(2545) :
error C2275: 'KJS::HTMLCollectionProto' :
illegal use of this type as an expression

because of the function call in the KJS_IMPLEMENT_PROTOTYPE macro

    JSObject *ClassProto::self(ExecState *exec) \
    { \
      return cacheGlobalObject<ClassProto>(exec, *name()); \
    } \

Msvc thinks it could deduce the template parameter.
When I remove the template parameter it compiles,
but I don't think this gives o correct binary,
every created Object is a JSObject only,
or is it indeed possible to deduce ClassProto from the
function arguments?
If not then it is a msvc bug, if yes then there is a more
sophisticated template implementation in msvc than in gcc.

Simpler code with explicit function template parameters compiles
without problems, and I could not reproduce the error.

I'm using msvc 8.0 (Express 2005).

Peter



More information about the Khtml-devel mailing list