[LLVMbugs] [Bug 9612] New: -Wbool-conversions misses 'false' ICEs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Apr 2 14:44:32 PDT 2011


           Summary: -Wbool-conversions misses 'false' ICEs
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jyasskin at google.com
                CC: chandlerc at gmail.com, llvmbugs at cs.uiuc.edu,
                    dgregor at apple.com

$ cat test.cc
void foo(int* p);

void bar() {
    const bool kDebugMode = false;  // NULL pointer constant.
    foo(false);  // Warning.
    foo(false == true);  // No warning!
    foo(kDebugMode);  // No warning!
$ clang++ -Wbool-conversions -c test.cc
test.cc:5:9: warning: initialization of pointer of type 'int *' from literal
'false' [-Wbool-conversions]
    foo(false);  // Warning.
1 warning 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