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

Clang backend crashes when capturing VLA (variable length array) in lambda

    XMLWordPrintable

Details

    • All

    Description

      The code

      int main()
      {
          int msize = 4;
          float arr[msize];
          [&arr]{};
          return 0;
      }
      

      leads to the clang backend to abort. More exactly, the syntax highlighting gets corrupted, variables can't be looked up by crtl+click, and the following message shows up ~3 times every second:

      2020-03-14T23:27:35 Clang Code Model: Error: The clangbackend process has finished unexpectedly and was restarted.
      

      It's limited to VLA: Capturing a "normal" array works fine.

      Note: VLAs are not part of the C++ standard. But as VLAs are perfectly supported in QtCreator, I think their captures should also be.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            jlx Johanes Lorenz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes