[LLVMbugs] [Bug 14238] New: CommandLine.h cl::bits fails to compile with clang++ and g++ 4.7

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 1 16:21:58 PDT 2012


             Bug #: 14238
           Summary: CommandLine.h cl::bits fails to compile with clang++
                    and g++ 4.7
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: compile-fail
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: scott+llvm+bugzilla at pakin.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9484
  --> http://llvm.org/bugs/attachment.cgi?id=9484
Reproducer that compiles with g++ 4.6 but not g++ 4.7 or clang++

The attached LLVM pass compiles fine with GCC 4.6:

$ g++ --version | head -1
g++ (GCC) 4.6.1
$ llvm-config --cxxflags
-I/ssdsata/pakin/byfl/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O3 -fomit-frame-pointer -g
-fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC
-Woverloaded-virtual -Wcast-qual
$ g++ `llvm-config --cxxflags` hello.cpp -c

...but not with GCC 4.7:

$ g++ --version | head -1
g++ (GCC) 4.7.1
$ g++ `llvm-config --cxxflags` hello.cpp -c
In file included from hello.cpp:4:0:
/ssdsata/pakin/byfl/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}::FailType;
Storage = bool; ParserClass = llvm::cl::parser<{anonymous}::FailType>]’:
hello.cpp:32:72:   required from here
/ssdsata/pakin/byfl/include/llvm/Support/CommandLine.h:1510:5: error:
‘addValue’ was not declared in this scope, and no declarations were found by
argument-dependent lookup at the point of instantiation [-fpermissive]
/ssdsata/pakin/byfl/include/llvm/Support/CommandLine.h:1510:5: note:
declarations in dependent base ‘llvm::cl::bits_storage<{anonymous}::FailType,
bool>’ are not found by unqualified lookup
/ssdsata/pakin/byfl/include/llvm/Support/CommandLine.h:1510:5: note: use
‘this->addValue’ instead

...or with Clang++:

$ clang++ `llvm-config --cxxflags` hello.cpp -c
In file included from hello.cpp:4:
/ssdsata/pakin/byfl/include/llvm/Support/CommandLine.h:1510:5: error: use of
undeclared identifier 'addValue'
hello.cpp:11:3: note: in instantiation of member function
'llvm::cl::bits<<anonymous>::FailType, bool,
llvm::cl::parser<<anonymous>::FailType> >::handleOccurrence' requested here
  Fail("fail", cl::NotHidden, cl::CommaSeparated, cl::ValueOptional,
/ssdsata/pakin/byfl/include/llvm/Support/CommandLine.h:1476:8: note: must
qualify identifier to find this declaration in dependent base class
  void addValue(const T &V) {
1 error generated.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list