http://llvm.org/bugs/show_bug.cgi?id=21019

            Bug ID: 21019
           Summary: Using ErrorOr produces warnings when compiling with
                    clang.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Support Libraries
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

(This bug affects version 3.5, but it wasn't on the version list)

I get warnings related to llvm headers when compiling the following code with
clang and with extra warnings turned on.

---
#include <llvm/Support/ErrorOr.h>

int main(void)
{
        llvm::ErrorOr<int> blob = 42;
        return blob.get();
}
---
$ clang++ -Wall -Wextra $(llvm-config --cxxflags) test.cpp
In file included from test.cpp:1:
/usr/lib/llvm-3.5/include/llvm/Support/ErrorOr.h:198:47: warning: unused
parameter 'a' [-Wunused-parameter]
  static bool compareThisIfSameType(const T1 &a, const T2 &b) {
                                              ^
/usr/lib/llvm-3.5/include/llvm/Support/ErrorOr.h:198:60: warning: unused
parameter 'b' [-Wunused-parameter]
  static bool compareThisIfSameType(const T1 &a, const T2 &b) {
                                                           ^
2 warnings generated.
---

Looking at ErrorOr.h, the values a and b are infact not used, so I'm guessing
this is a bug in ErrorOr.h

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to