err:ISO C++ forbids declaration of 'PointerUnion4' with no type

Hello,

I’m running into a compile errors for PointerUnion4 in TemplateName.h

/usr/local/include/clang/AST/TemplateName.h:63:0 ISO C++ forbids declaration of ‘PointerUnion4’ with no type in /usr/local/include/clang/AST/TemplateName.h

class TemplateName {
typedef llvm::PointerUnion4<TemplateDecl *, OverloadedFunctionDecl *,
QualifiedTemplateName *,
DependentTemplateName *> StorageType;

How to I get the compiler to get passed this? In XCode, I tried using both the built clang compiler from the llvm/clang project and the one that comes stock with Mac OSX SnowLeopard. Both gave the same error.

Thanks for your help,

Craig

Hi-

Just to clarify here- are you trying to compile this code with clang?

Clang doesn’t yet have anything like proper support for C++. Try llvm-g++ instead.

Are you trying to compile Clang against an older version of LLVM? PointerUnion4 should be defined in llvm/ADT/PointerUnion.h.

  • Doug

Are you trying to compile Clang against an older version of LLVM? PointerUnion4 should be defined in llvm/ADT/PointerUnion.h.

Yes, that was my problem! I didn’t copy over the proper headers to /usr/local/include (and save-off the shipping ones)

Thanks,
Craig

Are your llvm and clang trees the same SVN revision number?

-Chris

Hi Chris. Yep. They have the same revision # of 81368

Craig