From a74bdefc58a34b8054e61e84b480ad6cf0105ad2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 7 May 2020 18:11:47 +0200 Subject: [PATCH] documentation/doxygen: can't keep up with the bugs. 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 | 5 ++++ ...lassRoot_1_1Directory_1_1Sub_1_1Class.html | 4 +-- .../cpp_function_attributes/input.h | 17 ++++++++++- .../cpp_function_attributes/structFoo.html | 30 ++++++++++++++++++- 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/documentation/doxygen.py b/documentation/doxygen.py index 4b600f1f..d355b51a 100755 --- a/documentation/doxygen.py +++ b/documentation/doxygen.py @@ -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' diff --git a/documentation/test_doxygen/compound_listing/classRoot_1_1Directory_1_1Sub_1_1Class.html b/documentation/test_doxygen/compound_listing/classRoot_1_1Directory_1_1Sub_1_1Class.html index a69e47a3..b24aa59e 100644 --- a/documentation/test_doxygen/compound_listing/classRoot_1_1Directory_1_1Sub_1_1Class.html +++ b/documentation/test_doxygen/compound_listing/classRoot_1_1Directory_1_1Sub_1_1Class.html @@ -98,8 +98,8 @@

Public static variables

-
- static int Size constexpr +
+ static static int Size constexpr
A public static var.
diff --git a/documentation/test_doxygen/cpp_function_attributes/input.h b/documentation/test_doxygen/cpp_function_attributes/input.h index 76ef644a..119c7d5f 100644 --- a/documentation/test_doxygen/cpp_function_attributes/input.h +++ b/documentation/test_doxygen/cpp_function_attributes/input.h @@ -1,7 +1,22 @@ #include -/** @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 * diff --git a/documentation/test_doxygen/cpp_function_attributes/structFoo.html b/documentation/test_doxygen/cpp_function_attributes/structFoo.html index 85ba0c58..93a0882e 100644 --- a/documentation/test_doxygen/cpp_function_attributes/structFoo.html +++ b/documentation/test_doxygen/cpp_function_attributes/structFoo.html @@ -22,19 +22,33 @@

Foo struct

-

Pathological cases of noexcept.

+

Pathological cases of function attributes.

+
+

Public static functions

+
+
+ static auto constexprStaticFunction() -> int constexpr +
+
Constexpr before static.
+
+ static auto staticConstexprFunction() -> int constexpr +
+
Constexpr after static.
+
+

Constructors, destructors, conversion operators

@@ -71,6 +85,20 @@

Function documentation

+
+

+ static int Foo::constexprStaticFunction() constexpr +

+

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?!

+
+
+

+ static int Foo::staticConstexprFunction() constexpr +

+

Constexpr after static.

+

In this case, static is not in the return type. FFS.

+

Foo::Foo(Foo&&) defaulted noexcept -- 2.30.2