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

Wrong warning about number of arguments for a functor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 2.8.0-beta
    • Qt Creator 2.7.0
    • C/C++/Obj-C++ Support
    • None
    • debian testing amd64 with KDE 4.8.4

    Description

      Hi!

      Here is a small example:

      struct Foo
      {
        Foo(int a) : my_a(a) {}
        int operator()(int a, int b) { return my_a + a + b; }
      private:
        int my_a;
      };
      
      int main()
      {
        int a = 0, b = 0;
        Foo foo(a);
        return foo(a, b);
      }
      

      qtc underlines foo(a, b) in main() with 'too many arguments' hint. But if I replace argument in constructor by a constant, for example
      Foo foo(1)
      then qtc parses code correctly.

      Attachments

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

        Activity

          People

            erikv Erik Verbruggen
            genacid gena
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes