This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/51531] New: bool conversion to pointer should warn


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

             Bug #: 51531
           Summary: bool conversion to pointer should warn
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tutufan@gmail.com


/* clang 3.1 (trunk 145840) warns

bool-convert.cpp:12:14: warning: initialization of pointer of type 'int *' to
null from a constant boolean
      expression [-Wbool-conversions]
    int *p = false;
             ^~~~~

*/


int
main() {

    int *p = false;

    return !!p;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]