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

wrong "current symbol" in lambda arg of dispatch_async

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 18.0.0
    • C/C++/Obj-C++ Support
    • None
    • macOS

      i came across an odd glitch in objective-c code, e.g. qt6-dev/qtmultimedia/src/plugins/multimedia/darwin/avfaudiodecoder.mm

      there is a dispatch_async with a lambda function:

              dispatch_async(m_decodingQueue, [=, this]() {
                  if (!weakContext.expired() && CMSampleBufferDataIsReady(sampleBuffer)) {
                      auto audioBuffer = handleNextSampleBuffer(format, sampleBuffer);
      
                      if (audioBuffer.isValid())
                          invokeWithDecodingContext(weakContext, [=, this]() {
                              handleNewAudioBuffer(audioBuffer);
                          });
                  }
              });
      

      when having the text cursor inside the lambda, the `dispatch_async` symbol is highlighted as "current symbol", and "follow symbol under cursor" jumps to the definition of `async_dispatch`.

      observation:

      • the behaviour is identical, no matter where in the lambda the text cursor is (lambda body, capture, arguments)
      • i'm only seeing this with dispatch_async. not when passing lambda functions as argument to other functions, so i wonder if it might be related to dispatch_block_t

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

            kandeler Christian Kandeler
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes