[cfe-dev] Small Patch and VS2005 enum pb

Chris Lattner clattner at apple.com
Sat Dec 1 11:01:53 PST 2007


On Dec 1, 2007, at 4:11 AM, Cédric Venet wrote:
> A small patch for adding:
> - a missing include <string> in a header

Applied!

> - a missing file ASTConsumer.cpp in clangAST projet for VS

This part conflicted when I applied it.  Please ensure it is relative  
to an updated tree.

> More specifically, the problem is in DeclSpec.h at the line 64 and  
> 111 and
> 174:

Ok.

>
> TST TypeSpecType : 4;
>
> TST getTypeSpecType() const { return TypeSpecType; }
>
> =========
>
> And VS2005 as the good idea to return -4 instead of 12 for struct  
> type (same
> problem for all the type >=8).

I think the best way to solve this is to change the definition of  
TypeSpecType to:

unsigned TypeSpecType : 4;  // really should be TST, marking this  
'unsigned' for MSVC++

And then make the accessor do:

TST getTypeSpecType() const { return (TST)TypeSpecType; }

Sound good?

-Chris





More information about the cfe-dev mailing list