chiark / gitweb /
documentation/doxygen: noexcept and constexpr no longer leaks into types.
authorVladimír Vondruš <mosra@centrum.cz>
Fri, 13 Sep 2024 21:25:09 +0000 (23:25 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 14 Sep 2024 00:46:33 +0000 (02:46 +0200)
Since Doxygen 1.11. Which means I now have to use the attributes. No
change to the test files is needed, without this change 1.11+ would
produce output that doesn't have noexcept and constexpr.

documentation/doxygen.py

index c242416de8bacf5ee21da2a86b53189a71b845a6..3faf179f9eee2baaa58bd22a77bf2b2fc159f340 100755 (executable)
@@ -2135,6 +2135,15 @@ def parse_func(state: State, element: ET.Element):
     else:
         func.is_noexcept = False
         func.is_conditional_noexcept = False
+    # Noexcept can be also an attribute (since 1.8.16), merge with that. Until
+    # https://github.com/doxygen/doxygen/commit/b51d6d2dd2cb6a4945a3775a649e7eca8e120515
+    # (1.11) it seems it was present both in the signature and in the attribs.
+    if 'noexcept' in element.attrib:
+        func.is_noexcept = func.is_noexcept or element.attrib['noexcept'] == 'yes'
+    # noexceptexpression is since 1.11. If not present, it's not conditionally
+    # noexcept.
+    if 'noexceptexpression' in element.attrib:
+        func.is_conditional_noexcept = True
     # Put the rest (const, volatile, ...) into a suffix
     func.suffix = html.escape(signature[signature.rindex(')') + 1:].strip())
     if func.suffix: func.suffix = ' ' + func.suffix
@@ -2244,6 +2253,11 @@ def parse_var(state: State, element: ET.Element):
     # complicated with other possible keyword combinations. Fixed in 1.11.
     if var.type.startswith('static'):
         var.type = var.type[7:]
+    # Constexpr can be also an attribute, merge with that. Until
+    # https://github.com/doxygen/doxygen/commit/b51d6d2dd2cb6a4945a3775a649e7eca8e120515
+    # (1.11) it seems it was present both in the signature and in the attribs.
+    if 'constexpr' in element.attrib:
+        var.is_constexpr = var.is_constexpr or element.attrib['constexpr'] == 'yes'
     var.is_static = element.attrib['static'] == 'yes'
     var.is_protected = element.attrib['prot'] == 'protected'
     var.is_private = element.attrib['prot'] == 'private'