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

QDoc is unable to resolve the \typealias command for aliases declared trough a macro

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 6.3
    • Build tools: qdoc
    • None
    • DaVinci sprint 53

    Description

      The typealias command for QDoc is used to document C++ type aliases, such as using foo = bar;.

      When using a typealias command to document a public typealias from a class that was generated from a macro, QDoc seems unable to resolve the documentation to any alias.

      For example, if we had an header file:
       

      #define F(x) class x { public: using bar = int; };
      
      F(Foo)
      

      And somewhere a documentation:

      */!
      \class Foo
      ...
      */
      
      */!
      \typealias Foo::bar
      */
      

      When generating the documenation QDoc will provide a warning and be unable to generate the typealias documentation:

      (qdoc) warning: Cannot find 'Foo::bar' specified with '\typealias' in any header file
      

      If the header file contains the equivalent of the expanded code:

      class Foo { public: using bar = int; };
      

      Then QDoc will not fail to find the alias and correctly produce the documentation.

      The failure doesn't seem to be tied to generating the class itself but to the generation of the alias.

      If the header files is modified to the following:

      #define F using bar = int;
      
      class Foo { public: F };
      

      QDoc will fail to find the alias.

      More specifically, the issue seems to exist only when the identifier used for the alias is behind a macro. For example:

      #define F bar
      
      class Foo { public: using F = int; };
      

      Will fail but:

      #define F int
      
      class Foo { public: using bar = F; };
      

      Will succeed.

      QDoc should be able to find typealiases that generates their identifier trough a macro or definition. To solve the issue, for all of the above and similar examples, QDoc should be able to generate the typealias documentation correctly.

      Attachments

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

        Activity

          People

            diseraluca Luca Di Sera
            diseraluca Luca Di Sera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h

                Gerrit Reviews

                  There are no open Gerrit changes