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

Brace initializers break find usages on auto variables

    XMLWordPrintable

Details

    Description

      In the following code block

      struct TestStruct
      {
          int test;
      };
      
      void TestFn()
      {
          TestStruct a = TestStruct{};
          auto b = a;
          int x = b.test;
          auto c = TestStruct{1};
          x = c.test;
          auto d = TestStruct();
          x = d.test;
      }

      Find usages only finds usages of test from b and d. c is not found. This is a little strange as the refactor tool still gets it.

      This is a problem with the clang code model and the regular code model.

       

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            micksayson Mick Sayson
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes