chiark / gitweb /
doxygen: complain instead of blowing up if more \return-s are present.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 29 Jan 2018 18:53:24 +0000 (19:53 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 29 Jan 2018 18:53:24 +0000 (19:53 +0100)
doxygen/dox2html5.py
doxygen/test/compound_detailed/File.h
doxygen/test/compound_detailed/namespaceWarning.html

index a8b297184fc8ace210a3c7b033bfa04d94add46f..93176e850c5321747807d0c21c19acd96b8f8d0e 100755 (executable)
@@ -476,8 +476,10 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
 
             # Return value is separated from the text flow
             if i.attrib['kind'] == 'return':
-                assert not out.return_value
-                out.return_value = parse_desc(state, i)
+                if out.return_value:
+                    logging.warning("{}: superfluous @return section found, ignoring: {} ".format(state.current, parse_desc(state, i)))
+                else:
+                    out.return_value = parse_desc(state, i)
             # Ignore the RCS strings for now
             elif i.attrib['kind'] == 'rcs':
                 logging.warning("{}: ignoring {} kind of <simplesect>".format(state.current, i.attrib['kind']))
index 71cd3f1b75c14a6aa0c167b90b2fcdbf949a811c..a3bea6da004da409e0c8873d72fb83be1dac7c1a 100644 (file)
@@ -177,6 +177,8 @@ enum Enum {
 /**
 @brief Wrong
 @param wrong This parameter is not here
+@return Returns nothing.
+@return Returns nothing, but second time. This is ignored.
 */
 void bar();
 
index ab9d2ecdccf00841d45e4afa4d680585b984a600..86b18d5f09d624e0aa80251adc88a807ccbfc794 100644 (file)
           <h2><a href="#func-members">Functions</a></h3>
           <dl class="m-dox">
             <dt>
-              <span class="m-dox-wrap-bumper">void <a href="#a084dfc535219dee446df1c710e215839" class="m-dox-self" name="a084dfc535219dee446df1c710e215839">bar</a>(</span><span class="m-dox-wrap">)</span>
+              <span class="m-dox-wrap-bumper">void <a href="#a084dfc535219dee446df1c710e215839" class="m-dox">bar</a>(</span><span class="m-dox-wrap">)</span>
             </dt>
             <dd>Wrong.</dd>
           </dl>
         </section>
+        <section>
+          <h2>Function documentation</h2>
+          <section class="m-dox-details" id="a084dfc535219dee446df1c710e215839"><div>
+            <h3>
+              <span class="m-dox-wrap-bumper">void Warning::<wbr /></span><span class="m-dox-wrap"><span class="m-dox-wrap-bumper"><a href="#a084dfc535219dee446df1c710e215839" class="m-dox-self">bar</a>(</span><span class="m-dox-wrap">)</span></span>
+            </h3>
+            <p>Wrong.</p>
+            <table class="m-table m-fullwidth m-flat">
+              <tfoot>
+                <tr>
+                  <th style="width: 1%">Returns</th>
+                  <td>Returns nothing.</td>
+                </tr>
+              </tfoot>
+            </table>
+          </div></section>
+        </section>
       </div>
     </div>
   </div>