chiark / gitweb /
documentation/doxygen: can't keep up with the bugs.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 7 May 2020 16:11:47 +0000 (18:11 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 7 May 2020 18:24:39 +0000 (20:24 +0200)
Now there's a superfluous static in the function return type. (Yes, the
hash difference is due to this. Yes, I smelled the regression
correctly.)

documentation/doxygen.py
documentation/test_doxygen/compound_listing/classRoot_1_1Directory_1_1Sub_1_1Class.html
documentation/test_doxygen/cpp_function_attributes/input.h
documentation/test_doxygen/cpp_function_attributes/structFoo.html

index 4b600f1fb9424a59dabd905af2c065bc97143148..d355b51a0e5ead06ba4aca36db097c255f8790ed 100755 (executable)
@@ -1874,6 +1874,11 @@ def parse_func(state: State, element: ET.Element):
         func.is_constexpr = True
     else:
         func.is_constexpr = False
+    # When 1.8.18 encounters `constexpr static`, it keeps the static there. For
+    # `static constexpr` it doesn't. In both cases the static="yes" is put
+    # there correctly. WHY DOXYGEN, WHY?!
+    if func.type.startswith('static'):
+        func.type = func.type[7:]
     func.prefix = ''
     func.is_explicit = element.attrib['explicit'] == 'yes'
     func.is_virtual = element.attrib['virt'] != 'non-virtual'
index a69e47a3e34237e038c5e71ab95a8cc47da09399..b24aa59e0cc483c0fc0afd9b692201827ad9a715 100644 (file)
@@ -98,8 +98,8 @@
         <section id="pub-static-attribs">
           <h2><a href="#pub-static-attribs">Public static variables</a></h2>
           <dl class="m-doc">
-            <dt id="a37f97d663491ff54fda7f9cfc3080006">
-              static int <a href="#a37f97d663491ff54fda7f9cfc3080006" class="m-doc-self">Size</a> <span class="m-label m-flat m-primary">constexpr</span>
+            <dt id="a912d8f1390853f90e0a9f19ec98771e6">
+              static static int <a href="#a912d8f1390853f90e0a9f19ec98771e6" class="m-doc-self">Size</a> <span class="m-label m-flat m-primary">constexpr</span>
             </dt>
             <dd>A public static var.</dd>
           </dl>
index 76ef644aa213364d6e460a63d1a2a823f5b26ca0..119c7d5f0ff9abf483b66fec1ef54dd1b48ae2a7 100644 (file)
@@ -1,7 +1,22 @@
 #include <type_traits>
 
-/** @brief Pathological cases of noexcept */
+/** @brief Pathological cases of function attributes */
 struct Foo {
+    /**
+     * @brief Constexpr before static
+     *
+     * 1.8.18 puts both `constexpr` and `static` into the return type so I have
+     * to remove them. WHY! HOW IS THAT USEFUL IN ANY WAY?!
+     */
+    constexpr static int constexprStaticFunction();
+
+    /**
+     * @brief Constexpr after static
+     *
+     * In this case, `static` is not in the return type. FFS.
+     */
+    static constexpr int staticConstexprFunction();
+
     /**
      * @brief Combined default and noexcept
      *
index 85ba0c58297d1562fb1e8b7f229c1a14048d06e4..93a0882e920f294d95c01a8972ebac669c2b5e4c 100644 (file)
         <h1>
           Foo <span class="m-thin">struct</span>
         </h1>
-        <p>Pathological cases of noexcept.</p>
+        <p>Pathological cases of function attributes.</p>
         <div class="m-block m-default">
           <h3>Contents</h3>
           <ul>
             <li>
               Reference
               <ul>
+                <li><a href="#pub-static-methods">Public static functions</a></li>
                 <li><a href="#typeless-methods">Constructors, destructors, conversion operators</a></li>
                 <li><a href="#pub-methods">Public functions</a></li>
               </ul>
             </li>
           </ul>
         </div>
+        <section id="pub-static-methods">
+          <h2><a href="#pub-static-methods">Public static functions</a></h2>
+          <dl class="m-doc">
+            <dt>
+              <span class="m-doc-wrap-bumper">static auto <a href="#a77f46786436a39eb3b53343580f41b89" class="m-doc">constexprStaticFunction</a>(</span><span class="m-doc-wrap">) -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
+            </dt>
+            <dd>Constexpr before static.</dd>
+            <dt>
+              <span class="m-doc-wrap-bumper">static auto <a href="#a178c5f6f19fa2ffb1fc7a346e2e877d9" class="m-doc">staticConstexprFunction</a>(</span><span class="m-doc-wrap">) -&gt; int <span class="m-label m-flat m-primary">constexpr</span></span>
+            </dt>
+            <dd>Constexpr after static.</dd>
+          </dl>
+        </section>
         <section id="typeless-methods">
           <h2><a href="#typeless-methods">Constructors, destructors, conversion operators</a></h2>
           <dl class="m-doc">
         </section>
         <section>
           <h2>Function documentation</h2>
+          <section class="m-doc-details" id="a77f46786436a39eb3b53343580f41b89"><div>
+            <h3>
+              <span class="m-doc-wrap-bumper">static int Foo::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a77f46786436a39eb3b53343580f41b89" class="m-doc-self">constexprStaticFunction</a>(</span><span class="m-doc-wrap">) <span class="m-label m-primary">constexpr</span></span></span>
+            </h3>
+            <p>Constexpr before static.</p>
+<p>1.8.18 puts both <code>constexpr</code> and <code>static</code> into the return type so I have to remove them. WHY! HOW IS THAT USEFUL IN ANY WAY?!</p>
+          </div></section>
+          <section class="m-doc-details" id="a178c5f6f19fa2ffb1fc7a346e2e877d9"><div>
+            <h3>
+              <span class="m-doc-wrap-bumper">static int Foo::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#a178c5f6f19fa2ffb1fc7a346e2e877d9" class="m-doc-self">staticConstexprFunction</a>(</span><span class="m-doc-wrap">) <span class="m-label m-primary">constexpr</span></span></span>
+            </h3>
+            <p>Constexpr after static.</p>
+<p>In this case, <code>static</code> is not in the return type. FFS.</p>
+          </div></section>
           <section class="m-doc-details" id="ad5953d17211071264b501747c67e6fdc"><div>
             <h3>
               <span class="m-doc-wrap-bumper"> Foo::<wbr /></span><span class="m-doc-wrap"><span class="m-doc-wrap-bumper"><a href="#ad5953d17211071264b501747c67e6fdc" class="m-doc-self">Foo</a>(</span><span class="m-doc-wrap"><a href="structFoo.html" class="m-doc">Foo</a>&amp;&amp;) <span class="m-label m-info">defaulted</span> <span class="m-label m-success">noexcept</span></span></span>