void foo(const char *); 
void bar() { foo(false); }

should warn that 'false' is interpreted as NULL pointer constant and as such
is convertible to const char *.  (Through false -> (int)0 -> NULL -> (const
char *)0)

As foo(true) is (rightfully) rejected the case above is usually not intended.

See 4.10.


-- 
           Summary: Should warn about boolean constant false used in pointer
                    context
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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

Reply via email to