Hi,<div><br></div><div>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...</div>
<div><br></div><div><div>  enum testx</div><div>  {</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>  A,B</div><div>  };</div><div>  cl::bits<testx> queryLoggingOptions("option",cl::values(</div>
<div>       clEnumVal(A,"this is a"),</div><div>       clEnumVal(B,"this is b"),</div><div>       clEnumValEnd</div><div>  <span class="Apple-tab-span" style="white-space:pre">   </span>  )</div><div><br>
</div><div>  );</div></div><div><br></div><div>And when I compile (gcc 4.7.1 20120721 (prerelease) ) I get an error like this...</div><div><br></div><div><div>In file included from /home/dan/documents/projects/project/klee/src/lib/Core/Executor.cpp:60:0:</div>
<div>/home/dan/documents/projects/project/llvm-2.9/src/include/llvm/Support/CommandLine.h: 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>]’:</div>
<div>/home/dan/documents/projects/project/klee/src/lib/Core/Executor.cpp:3448:1:   required from here</div><div>/home/dan/documents/projects/project/llvm-2.9/src/include/llvm/Support/CommandLine.h:1220:5: error: ‘addValue’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]</div>
<div>/home/dan/documents/projects/project/llvm-2.9/src/include/llvm/Support/CommandLine.h:1220:5: note: declarations in dependent base ‘llvm::cl::bits_storage<{anonymous}::testx, bool>’ are not found by unqualified lookup</div>
<div>/home/dan/documents/projects/project/llvm-2.9/src/include/llvm/Support/CommandLine.h:1220:5: note: use ‘this->addValue’ instead</div><div>/bin/rm: cannot remove ‘/home/dan/documents/projects/project/klee/bin-rel/lib/Core/Release+Asserts/Executor.d.tmp’: No such file or directory</div>
</div><div><br></div><div>I think this is related to "Name Look up Change" in <a href="http://gcc.gnu.org/gcc-4.7/porting_to.html">http://gcc.gnu.org/gcc-4.7/porting_to.html</a> . Indeed if I modify LLVM 2.9's header file to use ``this->addValue()'' instead of ``addValue()'' I can than successfully compile.</div>
<div><br></div><div>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 ( <a href="https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Support/CommandLine.h#1512">https://github.com/llvm-mirror/llvm/blob/master/include/llvm/Support/CommandLine.h#1512</a> ) 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?</div>
<div><br></div><div>Regards,</div><div>Dan Liew.</div>