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

Incorrect output parameter highlighting for std::optional

    XMLWordPrintable

Details

    • Linux/X11
    • 06ce449a01 (qt-creator/qt-creator/7.0) 06ce449a01 (qt-creator/qt-creator/master) 06ce449a01 (qt-creator/qt-creator/qds-3.3) 06ce449a01 (qt-creator/tqtc-qt-creator/7.0)

    Description

      In the following code sample, s.opt_my_struct1 in foo's second line is formatted as an output parameter:

      #include <optional>
      
      struct my_struct1
      {
      	int value;
      };
      
      struct my_struct2
      {
      	std::optional< my_struct1 > opt_my_struct1;
      };
      
      int produce_int();
      
      void foo(my_struct2& s)
      {
      	s.opt_my_struct1.emplace();
      	s.opt_my_struct1->value = produce_int();
      }
      

      This reproduces with clangd enabled.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            lastique Andrey Semashev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes