http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48420

           Summary: Missed -Wconversion-null warning when passing const
                    bool to T*
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jyass...@gcc.gnu.org


$ g++-mp-4.6 -Wconversion-null -c test.cc
dhcp-172-19-248-71:~/tmp$ cat test.cc
void foo(int* p);

void bar() {
    const bool kDebugMode = false;  // NULL pointer constant.
    foo(kDebugMode);  // But no warning!
}
$ g++-mp-4.6 -Wconversion-null -c test.cc
$ 

Changing the kDebugMode to 'false' or a false expression involving an enum
triggers the warning.

Reply via email to