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

Qt Creator can't deal with functions named 'emit'

    XMLWordPrintable

Details

    • Linux/X11
    • 480f5366d (13.0)

    Description

      If I create a trivial C++ program:

      #include <iostream>
      void emit(int val)
      {
          std::cout << val << '\n';
      }
      int main(int argc, char** argv)
      {
          emit(42);
          return 0;
      }
      

       

       

      This program compiles and runs just fine. However, when I open it in Qt Creator, I get a bunch of errors around the emit function.

      If I change the name of the function to something else, the errors go away.

      It seems like emit might mean something special in Qt-land and so even for non-Qt C++ projects Qt Creator treats it as a keyword.

      Attachments

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

        Activity

          People

            cadam Cristian Adam
            nathanb Nathan Baker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes