Build problem in current svn

I'm trying to build LLVM on OPENBSD current with today's svn (feb 23), and it fails to build with the following errors:

llvm[2]: Compiling ELFWriter.cpp for Release build
In file included from ELFWriter.cpp:51:
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:345: error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:345: error: non-member function 'unsigned int llvm::getPersonalityEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:346: error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:346: error: non-member function 'unsigned int llvm::getLSDAEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:347: error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:347: error: non-member function 'unsigned int llvm::getFDEEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:348: error: non-member function 'unsigned int llvm::getTTypeEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:350: error: expected unqualified-id before 'protected'
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:354: error: extra ';'
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:356: error: expected declaration before '}' token
gmake[2]: *** [/root/llvm/lib/CodeGen/Release/ELFWriter.o] Error 1
gmake[2]: Leaving directory `/root/llvm/lib/CodeGen'
gmake[1]: *** [CodeGen/.makeall] Error 2
gmake[1]: Leaving directory `/root/llvm/lib'
gmake: *** [all] Error 1

When I look at include/llvm/Target/TargetLoweringObjectFile.h, I noticed that there is an odd number of '}', making the '} // end namespace llvm' close nothing.

Max wrote:

I'm trying to build LLVM on OPENBSD current with today's svn (feb 23), and it fails to build with the following errors:

llvm[2]: Compiling ELFWriter.cpp for Release build
In file included from ELFWriter.cpp:51:
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:345: error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:345: error: non-member function 'unsigned int llvm::getPersonalityEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:346: error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:346: error: non-member function 'unsigned int llvm::getLSDAEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:347: error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:347: error: non-member function 'unsigned int llvm::getFDEEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h error: virtual outside class declaration
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:348: error: non-member function 'unsigned int llvm::getTTypeEncoding()' cannot have cv-qualifier
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:350: error: expected unqualified-id before 'protected'
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:354: error: extra ';'
/root/llvm/include/llvm/Target/TargetLoweringObjectFile.h:356: error: expected declaration before '}' token
gmake[2]: *** [/root/llvm/lib/CodeGen/Release/ELFWriter.o] Error 1
gmake[2]: Leaving directory `/root/llvm/lib/CodeGen'
gmake[1]: *** [CodeGen/.makeall] Error 2
gmake[1]: Leaving directory `/root/llvm/lib'
gmake: *** [all] Error 1

When I look at include/llvm/Target/TargetLoweringObjectFile.h, I noticed that there is an odd number of '}', making the '} // end namespace llvm' close nothing.

sorry, my copy was just messed up, ignore the noise.

I don't see this, the file looks fine to me. Are you sure there isn't a macro from a system header clobbering something?

Actually, it looks like you have something more basic going wrong. TargetLoweringObjectFile.h on mainline only has 203 lines.

-Chris