Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71123

"moc" failed to parse auto in trailing-return-type signals and slots

    XMLWordPrintable

    Details

    • Platform/s:
      Windows

      Description

      If I try to write signals/slots with trailing-return-type as described here(https://en.cppreference.com/w/cpp/language/function), that feature become available with C++11 standard decltype.

      signals:
          auto testSignal() -> void;
      
      public slots:
          auto testSlot() -> void;
      

      But my compilation faild, as I understand moc cannot parse this signature, and gives error like that:

      \AutoReturn\TestClass.hpp -o debug\moc_TestClass.cpp
      ..\AutoReturn\TestClass.hpp(12): Parse error at ":"
      

      You could reproduce this issue on my small example AutoReturn.zip

        Attachments

        For Gerrit Dashboard: QTBUG-71123
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            manordheim Mårten Nordheim
            Reporter:
            AndriySlisarchuk Andriy Slisarchuk
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There is 1 open Gerrit change