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

C++: Parsing of classes nested in functions is broken

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Qt Creator 2.2.0, Qt Creator 3.1.0-beta
    • C/C++/Obj-C++ Support
    • None
    • 68d6a762d914b0cfc1ede64161b14808d6e9b0ab

      If you have the following code in Creator:

      void foo()
      {
          
      }
      
      int bar()
      {
          struct Nested
          {
              int foo() { return 42; }
              int i;
              Nested()
              {
                  i = foo(); /* line 14 */
              }
          };
          Nested n;
          n.i++; /* line 18 */
      }
      

      The C++ support is unable to properly understand the nested class bar()::Nested. For example, the following happens:

      • Bad navigation on line 14:
        1. move the cursor to foo on line 14
        2. press F2
        • ACTUAL: Creator navigates to line 1
        • EXPECTED: Creator should have navigated to line 10
      • No completion on line 18:
        1. move the cursor to between n. and i on line 14
        2. press Ctrl+Space
        • ACTUAL: nothing happens
        • EXPECTED: Creator should have shown a drop-down list with elements "foo", "i" and "Nested"

        For Gerrit Dashboard: QTCREATORBUG-3620
        # Subject Branch Project Status CR V

            erikv Erik Verbruggen
            tmacieir Thiago Macieira (closed Nokia identity) (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes