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

support code completion for coroutines in clang code model + gcc compiler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • Qt Creator 4.13.0
    • None
    • All

    Description

      I've been using qtcreator with GCC 10.2 and coroutines enabled in a CMake project. It builds fine, but it looks like the Clang code model (code completion) doesn't properly support this yet. In code that uses it, you get errors like:

      error: std::experimental::coroutine_traits type was not found; include <experimental/coroutine> before defining a coroutine

      The example just includes <coroutine> cpp header. Navigating into this (GCC) header, there's the following #if:
      #if __cpp_impl_coroutine

      Clang code model thinks this if-statement is false, even though during actual compilation it is true (as I'm building with GCC with C++20 + -fcoroutines). Because it thinks it's false, it skips the whole header. From what I can see, the clang that ships with qtcreator, should have support for coroutines though - it's just that it doesn't parse the header the right way.

      Reproducible by just defining an empty function with 'co_return' in it - clang code model should complain about this.

      Is there any work-around for this?

      Attachments

        1. image-2020-09-14-13-01-25-886.png
          133 kB
          Floris van Nee
        2. image-2020-09-14-13-02-08-339.png
          73 kB
          Floris van Nee
        3. tst_project.tar.gz
          2 kB
          Floris van Nee

        Issue Links

          Activity

            People

              kandeler Christian Kandeler
              fvannee Floris van Nee
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: