var.is_constexpr = True
else:
var.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. Same case is for functions, although there it's further
+ # complicated with other possible keyword combinations. Fixed in 1.11.
+ if var.type.startswith('static'):
+ var.type = var.type[7:]
var.is_static = element.attrib['static'] == 'yes'
var.is_protected = element.attrib['prot'] == 'protected'
var.is_private = element.attrib['prot'] == 'private'
<h2><a href="#pub-static-attribs">Public static variables</a></h2>
<dl class="m-doc">
<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>
+ 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>
*/
constexpr static int constexprStaticFunction();
+ /**
+ * @brief Constexpr before static, a variable
+ *
+ * 1.8.18 again puts both `constexpr` and `static` into the return type so
+ * I have to remove them.
+ */
+ constexpr static int ConstexprStaticVariable = 0;
+
/**
* @brief Consteval before static
*
*/
static constexpr int staticConstexprFunction();
+ /**
+ * @brief Constexpr after static, a variable
+ *
+ * Here `static` is not in the type either.
+ */
+ static constexpr int StaticConstexprVariable = 0;
+
/**
* @brief Consteval after static
*
<li>
Reference
<ul>
+ <li><a href="#pub-static-attribs">Public static variables</a></li>
<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>
</li>
</ul>
</nav>
+ <section id="pub-static-attribs">
+ <h2><a href="#pub-static-attribs">Public static variables</a></h2>
+ <dl class="m-doc">
+ <dt>
+ static int <a href="#a3fca5e0d9720095041dce1c150d3c9f8" class="m-doc">ConstexprStaticVariable</a> <span class="m-label m-flat m-primary">constexpr</span>
+ </dt>
+ <dd>Constexpr before static, a variable.</dd>
+ <dt>
+ static int <a href="#aca521b15a93807423e798f96b1bdde5a" class="m-doc">StaticConstexprVariable</a> <span class="m-label m-flat m-primary">constexpr</span>
+ </dt>
+ <dd>Constexpr after static, a variable.</dd>
+ </dl>
+ </section>
<section id="pub-static-methods">
<h2><a href="#pub-static-methods">Public static functions</a></h2>
<dl class="m-doc">
<p>For some reason, due to decltype(auto), Doxygen swaps the order, causing the constexpr to be hard to detect. Don't even ask how it handles trailing return types. It's just HORRIBLE.</p>
</div></section>
</section>
+ <section>
+ <h2>Variable documentation</h2>
+ <section class="m-doc-details" id="a3fca5e0d9720095041dce1c150d3c9f8"><div>
+ <h3>
+ static int Foo::<wbr /><a href="#a3fca5e0d9720095041dce1c150d3c9f8" class="m-doc-self">ConstexprStaticVariable</a> <span class="m-label m-primary">constexpr</span>
+ </h3>
+ <p>Constexpr before static, a variable.</p>
+<p>1.8.18 again puts both <code>constexpr</code> and <code>static</code> into the return type so I have to remove them.</p>
+ </div></section>
+ <section class="m-doc-details" id="aca521b15a93807423e798f96b1bdde5a"><div>
+ <h3>
+ static int Foo::<wbr /><a href="#aca521b15a93807423e798f96b1bdde5a" class="m-doc-self">StaticConstexprVariable</a> <span class="m-label m-primary">constexpr</span>
+ </h3>
+ <p>Constexpr after static, a variable.</p>
+<p>Here <code>static</code> is not in the type either.</p>
+ </div></section>
+ </section>
</div>
</div>
</div>
self.assertEqual(*self.actual_expected_contents('structFoo.html'))
self.assertEqual(*self.actual_expected_contents('structBar.html'))
-class FunctionAttributes(IntegrationTestCase):
+class FunctionVariableAttributes(IntegrationTestCase):
def test(self):
self.run_doxygen(wildcard='*.xml')
self.assertEqual(*self.actual_expected_contents('structFoo.html'))