[LLVMdev] Problem using llvm::cl::bits class with gcc 4.7

Delcypher delcypher at gmail.com
Fri Sep 14 08:43:19 PDT 2012


I'm currently working on the KLEE tool that uses LLVM (2.9 because that's
what KLEE currently uses) and in particular I'm having an unexpected
problem with the llvm::cl::bits class. I try something like this...

  enum testx
  cl::bits<testx> queryLoggingOptions("option",cl::values(
       clEnumVal(A,"this is a"),
       clEnumVal(B,"this is b"),


And when I compile (gcc 4.7.1 20120721 (prerelease) ) I get an error like

In file included from
In instantiation of ‘bool llvm::cl::bits<DataType, Storage,
ParserClass>::handleOccurrence(unsigned int, llvm::StringRef,
llvm::StringRef) [with DataType = {anonymous}::testx; Storage = bool;
ParserClass = llvm::cl::parser<{anonymous}::testx>]’:
  required from here
error: ‘addValue’ was not declared in this scope, and no declarations were
found by argument-dependent lookup at the point of instantiation
note: declarations in dependent base
‘llvm::cl::bits_storage<{anonymous}::testx, bool>’ are not found by
unqualified lookup
note: use ‘this->addValue’ instead
/bin/rm: cannot remove
No such file or directory

I think this is related to "Name Look up Change" in
http://gcc.gnu.org/gcc-4.7/porting_to.html . Indeed if I modify LLVM 2.9's
header file to use ``this->addValue()'' instead of ``addValue()'' I can
than successfully compile.

Is there anyway round this because I don't really want to have to patch
LLVM's header files specially for KLEE. I took a look at the latest LLVM
code (
and the line that's causing me compile problems doesn't seem to have
changed. Does that mean that no one else has had the problem or am I doing
something very wrong?

Dan Liew.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120914/05edd122/attachment.html>

More information about the llvm-dev mailing list