Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-32971

Wrong fix is applied for -Wpointer-bool-conversion

    XMLWordPrintable

Details

    Description

      I have the following code:

      bool foo();
      
      int main(){
          if(foo){    //Oops, forgot the parentheses
              //Do stuff
          }
          return 0;
      }
      

      As expected, Qt Creator gives me a warning saying "Address of function 'isProcessRunning' will always evaluate to 'true' (fix available)". This is great, but the problem is that if I click on the light bulb to apply the fix, it changes the line to `if(&foo)`, whereas I would expect it to change it to `if(foo())`.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            donaldduck Donald Duck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes