Small Patch and VS2005 enum pb

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

> - 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.

Strange, my tree was up to date (I just updated and there was no change on
this file).
It was perhaps caused by the version number which changed from 8.0 to 8,0
following my system local... I removed this modification from this patch, it
will perhaps work now...

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

Ok.

In fact, all the enum of the class are affected, so I patched them all (hope
there isn't more hiding somewhere)

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++

I put /*TST*/unsigned TypeSpecType : 4;

Forgot the commentary, sorry, can redo if needed

And then make the accessor do:

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

I also had to add some cast in the associate cpp file.

Sound good?

-Chris

A fast testing show it work. (or at least some bug are corrected)

UnsignedEnumVS.patch (5.79 KB)

- 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.

Strange, my tree was up to date (I just updated and there was no change on
this file).
It was perhaps caused by the version number which changed from 8.0 to 8,0
following my system local... I removed this modification from this patch, it
will perhaps work now...

Your new patch still doesn't apply. It may be a newline issue (windows vs unix). If you just send me the whole new file, I can commit it.

More specifically, the problem is in DeclSpec.h at the line 64 and

Ok.

In fact, all the enum of the class are affected, so I patched them all (hope
there isn't more hiding somewhere)

Looks great, applied, thanks!

-chris