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

QDoc cannot distinguish between template function overloads differing only in template arguments

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.0 FF
    • dev
    • Build tools: qdoc
    • None
    • e795898cc (dev), 848e31205 (dev), 1fcfc8f94 (dev), 482d11fdb (dev), 3ab35eeef (dev), 1ef89a727 (dev), 06db30d2b (dev), 505ac7007 (dev), 43aecf7dd (dev), a180dc5e2 (dev), 4ccd4118f (dev), 600cf294a (dev), 0cd75bf23 (dev), 51f3c7da8 (dev), fbef159a0 (dev)
    • DaVinci 90, DaVinci 91

    Description

      GIVEN A class like

      template <typename T, size_t E = std::dynamic_extent>
      class QSpan {
          ~~~~
          template <size_t Offset> QSpan<T> subspan() const;
          template <size_t Offset, size_t  Count> QSpan<T, Count> subspan() const;
      };
      

      WHEN Trying to document the two template functions like this:

      /*!
          \fn template <typename T, size_t E> template <size_t Offset> QSpan<T, E>::subspan() const
      
          Returns a span of size \c{E - Offset} referencing the remainder of this span
          after dropping the first \c{Offset} elements.
      
          If \c{*this} is a variable-sized span, the return type is a variable-sized
          span, otherwise it is a fixed-sized span.
      
          This span must hold at least \c{Offset} elements (\c{E} >= \c{Offset} \e{and}
          size() >= \c{Offset}), otherwise the behavior is undefined.
      */
      
      /*!
          \fn template <typename T, size_t E> template <size_t Offset, size_t Count> QSpan<T, E>::subspan() const
      
          Returns a span of size \c{Count} referencing the \c{Count} elements of this
          span starting at \c{Offset}.
      
          If \c{*this} is a variable-sized span, the return type is a variable-sized
          span, otherwise it is a fixed-sized span.
      
          This span must hold at least \c{Offset + Count} elements (\c{E} >=
          \c{Offset + Count} \e{and} size() >= \c{Offset + Count}), otherwise the
          behavior is undefined.
      */
      

      THEN QDoc throws an error that the second block overwrites the first:

      qspan.qdoc:403: (qdoc) warning: Overrides a previous doc
          [from here: qspan.qdoc:387]
      

      EXPECTED QDoc understands that these are two different functions and allows to document them separately.

      Attachments

        Issue Links

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

          Activity

            People

              diseraluca Luca Di Sera
              mmutz Marc Mutz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes