Em Quinta 09 Janeiro 2003 05:23, Alan Gutierrez escreveu: > Oh, yes! VC++ has bugs! But it has caught a couple of stucts that were > predeclared as classes, for example There is a thread in comp.std.c++ called "Forward declaration of a class as a struct" at (sorry about the long URL): http://groups.google.com/groups?hl=pt-PT&lr=&ie=UTF-8&oe=UTF-8&threadm=23b84d65.0205161115.2947ac09%40posting.google.com&rnum=1&prev=/groups%3Fq%3D%2522forward%2Bdeclaration%2522%2Bstruct%2Bclass%26hl%3Dpt-PT%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D23b84d65.0205161115.2947ac09%2540posting.google.com%26rnum%3D1 |> Is it legal to do a forward declaration of a class as struct (or |> vice versa)? |> i.e. is the following code legal: |> struct A; |> class A; |> It is accepted by GCC 2.95 and GCC 3.0; VC++ 6.0 gives a warning. |> What does the standard say? That it is legal. Both key words, class and struct, define a class -- there is no such thing as a struct in C++. Anyway, there is a more important question here. How far should KHTML's code be changed to work around VC++'s bugs ? I would say not far at all. It can be used as a tool to uncover bugs or an overreliance on gccisms but should not, at this point, be considered a supported compiler. Just my .02 euro, -- Luis Pedro Coelho http://blogs.salon.com/0001523