chiark / gitweb /
doxygen: support C++14 variable templates.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 30 Dec 2018 23:58:40 +0000 (00:58 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 31 Dec 2018 02:32:09 +0000 (03:32 +0100)
Interestingly enough, Doxygen already has the support and I just need
some basic template bureaucracy to get it running.

18 files changed:
doc/doxygen.rst
doxygen/dox2html5.py
doxygen/templates/details-var.html
doxygen/templates/entry-var.html
doxygen/test/compound_deprecated/namespaceDeprecatedNamespace.html
doxygen/test/compound_detailed/namespaceVar.html
doxygen/test/compound_detailed/structTemplate.html
doxygen/test/compound_listing/classRoot_1_1Directory_1_1Sub_1_1Class.html
doxygen/test/compound_listing/namespaceRoot_1_1Directory.html
doxygen/test/compound_namespace_members_in_file_scope/File_8h.html
doxygen/test/compound_namespace_members_in_file_scope/namespaceNamespace.html
doxygen/test/compound_namespace_members_in_file_scope_define_base_url/File_8h.html
doxygen/test/contents_unexpected_sections/File_8h.html
doxygen/test/cpp_variable_template/Doxyfile [new file with mode: 0644]
doxygen/test/cpp_variable_template/input.h [new file with mode: 0644]
doxygen/test/cpp_variable_template/structBar.html [new file with mode: 0644]
doxygen/test/cpp_variable_template/structFoo.html [new file with mode: 0644]
doxygen/test/test_cpp.py

index b46ecc1944df1e920903418f6da0c330ba0f059d..ae7e266a89e8cf99e6d9ba59363213bb1f35a64c 100644 (file)
@@ -1760,25 +1760,29 @@ every item has the following properties:
 
 .. class:: m-table m-fullwidth
 
-=========================== ===================================================
-Property                    Description
-=========================== ===================================================
-:py:`var.base_url`          Base URL of file containing detailed description
-                            [3]_
-:py:`var.id`                Identifier hash [3]_
-:py:`var.type`              Variable type [6]_
-:py:`var.name`              Variable name [4]_
-:py:`var.brief`             Brief description. Can be empty. [1]_
-:py:`var.description`       Detailed description. Can be empty. [2]_
-:py:`var.has_details`       If there is enough content for the full description
-                            block [5]_
-:py:`var.is_deprecated`     Whether the variable is deprecated. [7]_
-:py:`var.is_static`         If the variable is :cpp:`static`. Set only for
-                            member variables.
-:py:`var.is_protected`      If the variable is :cpp:`protected`. Set only for
-                            member variables.
-:py:`var.is_constexpr`      If the variable is :cpp:`constexpr`
-=========================== ===================================================
+=============================== ===============================================
+Property                        Description
+=============================== ===============================================
+:py:`var.base_url`              Base URL of file containing detailed
+                                description [3]_
+:py:`var.id`                    Identifier hash [3]_
+:py:`var.type`                  Variable type [6]_
+:py:`var.name`                  Variable name [4]_
+:py:`var.templates`             Template specification for C++14 variable
+                                templates. See `Template properties`_ for
+                                details.
+:py:`var.has_template_details`  If template parameters have description
+:py:`var.brief`                 Brief description. Can be empty. [1]_
+:py:`var.description`           Detailed description. Can be empty. [2]_
+:py:`var.has_details`           If there is enough content for the full
+                                description block [5]_
+:py:`var.is_deprecated`         Whether the variable is deprecated. [7]_
+:py:`var.is_static`             If the variable is :cpp:`static`. Set only for
+                                member variables.
+:py:`var.is_protected`          If the variable is :cpp:`protected`. Set only
+                                for member variables.
+:py:`var.is_constexpr`          If the variable is :cpp:`constexpr`
+=============================== ===============================================
 
 `Define properties`_
 ````````````````````
index 4a7d863ff0bf2fba738f4bfe5469fbfa2c7f6124..bcc27b68773ee0d0e1f9d310dfb01748bb47d613 100755 (executable)
@@ -1545,10 +1545,10 @@ def parse_enum_value_desc(state: State, element: ET.Element) -> str:
 def parse_var_desc(state: State, element: ET.Element) -> str:
     parsed = parse_desc_internal(state, element.find('detaileddescription'))
     parsed.parsed += parse_desc(state, element.find('inbodydescription'))
-    if parsed.templates or parsed.params or parsed.return_value or parsed.return_values or parsed.exceptions:
-        logging.warning("{}: unexpected @tparam / @param / @return / @retval / @exception found in variable description, ignoring".format(state.current))
+    if parsed.params or parsed.return_value or parsed.return_values or parsed.exceptions:
+        logging.warning("{}: unexpected @param / @return / @retval / @exception found in variable description, ignoring".format(state.current))
     assert not parsed.section # might be problematic
-    return (parsed.parsed, parsed.search_keywords, parsed.is_deprecated)
+    return (parsed.parsed, parsed.templates, parsed.search_keywords, parsed.is_deprecated)
 
 def parse_toplevel_desc(state: State, element: ET.Element):
     state.parsing_toplevel_desc = True
@@ -1850,9 +1850,10 @@ def parse_var(state: State, element: ET.Element):
     var.is_private = element.attrib['prot'] == 'private'
     var.name = element.find('name').text
     var.brief = parse_desc(state, element.find('briefdescription'))
-    var.description, search_keywords, var.is_deprecated = parse_var_desc(state, element)
+    var.description, templates, search_keywords, var.is_deprecated = parse_var_desc(state, element)
+    var.has_template_details, var.templates = parse_template_params(state, element.find('templateparamlist'), templates)
 
-    var.has_details = var.base_url == state.current_compound_url and var.description
+    var.has_details = var.base_url == state.current_compound_url and (var.description or var.has_template_details)
     if var.brief or var.has_details:
         # Avoid duplicates in search
         if var.base_url == state.current_compound_url and not state.doxyfile['M_SEARCH_DISABLED']:
index 0eabc81af2f5cf1b7b373679bae55a143257b795..2dbea7a40813a8a53d67873d18b9e3af04feb629 100644 (file)
@@ -1,9 +1,15 @@
           <section class="m-dox-details" id="{{ var.id }}"><div>
             <h3>
-              {% if compound.templates != None %}
+              {% if compound.templates != None or var.templates != None  %}
               <div class="m-dox-template">
+                {% if compound.templates != None %}
                 {% set j = joiner(', ') %}
                 template&lt;{% for t in compound.templates %}{{ j() }}{{ t.type }} {% if t.name %}{{ t.name }}{% else %}_{{ loop.index }}{% endif %}{% endfor %}&gt;
+                {% endif %}
+                {% if var.templates != None %}
+                {% set j = joiner(', ') %}
+                template&lt;{% for t in var.templates %}{{ j() }}{{ t.type }}{% if t.name %} {{ t.name }}{% endif %}{% if t.default %} = {{ t.default }}{% endif %}{% endfor %}&gt;
+                {% endif %}
               </div>
               {% endif %}
               {%+ if var.is_static %}static {% endif %}{{ var.type }} {{ prefix }}<a href="#{{ var.id }}" class="m-dox-self">{{ var.name }}</a>{% if var.is_protected %} <span class="m-label m-warning">protected</span>{% endif %}{% if var.is_constexpr %} <span class="m-label m-primary">constexpr</span>{% endif %}
             {% if var.brief %}
             <p>{{ var.brief }}</p>
             {% endif %}
+            {% if var.has_template_details %}
+            <table class="m-table m-fullwidth m-flat">
+              <thead>
+                <tr><th colspan="2">Template parameters</th></tr>
+              </thead>
+              <tbody>
+                {% for template in var.templates|selectattr('name') %}
+                <tr>
+                  <td{% if loop.index == 1 %} style="width: 1%"{% endif %}>{{ template.name }}</td>
+                  <td>{{ template.description }}</td>
+                </tr>
+                {% endfor %}
+              </tbody>
+            </table>
+            {% endif %}
+            {% if var.description %}
 {{ var.description }}
+            {% endif %}
           </div></section>
index 820cab85868860e93b076adffc628c213188453a..7dbe478030b58556089ce9c502c3e981e6ea4652 100644 (file)
@@ -1,2 +1,10 @@
-            <dt>{% if var.is_static %}static {% endif %}{{ var.type }} <a href="{% if var.base_url != compound.url %}{{ var.base_url }}{% endif %}#{{ var.id }}" {% if var.has_details or var.base_url != compound.url %}class="m-dox"{% else %}class="m-dox-self" name="{{ var.id }}"{% endif %}>{{ var.name }}</a>{% if var.is_deprecated %} <span class="m-label m-danger">deprecated</span>{% endif %}{% if mark_nonpublic and var.is_protected %} <span class="m-label m-flat m-warning">protected</span>{% endif %}{% if var.is_constexpr %} <span class="m-label m-flat m-primary">constexpr</span>{% endif %}</dt>
+            <dt>
+              {% if var.templates != None %}
+              {% set j = joiner(', ') %}
+              <div class="m-dox-template">template&lt;{% for t in var.templates %}{{ j() }}{{ t.type }}{% if t.name %} {{ t.name }}{% endif %}{% if t.default %} = {{ t.default }}{% endif%}{% endfor %}&gt;</div>
+              {% endif %}
+              {%+ if var.is_static %}static {% endif %}{{ var.type }} <a href="{% if var.base_url != compound.url %}{{ var.base_url }}{% endif %}#{{ var.id }}" {% if var.has_details or var.base_url != compound.url %}class="m-dox"{% else %}class="m-dox-self" name="{{ var.id }}"{% endif %}>{{ var.name }}</a>{% if var.is_deprecated %} <span class="m-label m-danger">deprecated</span>{% endif %}{% if mark_nonpublic and var.is_protected %} <span class="m-label m-flat m-warning">protected</span>{% endif %}{% if var.is_constexpr %} <span class="m-label m-flat m-primary">constexpr</span>{% endif %}
+              {# This empty line needs to be there otherwise it's eaten #}
+
+            </dt>
             <dd>{{ var.brief }}</dd>
index c27d1916bdccc915ed58742184e7841d5ea4f6b6..96369bb9abc5f16d074781df7c429f313302d097 100644 (file)
@@ -96,7 +96,9 @@
         <section id="var-members">
           <h2><a href="#var-members">Variables</a></h2>
           <dl class="m-dox">
-            <dt>int <a href="#ae934297fc39624409333eefbfeabf5e5" class="m-dox">DeprecatedVariable</a> <span class="m-label m-danger">deprecated</span> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              int <a href="#ae934297fc39624409333eefbfeabf5e5" class="m-dox">DeprecatedVariable</a> <span class="m-label m-danger">deprecated</span> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A variable.</dd>
           </dl>
         </section>
index 769d423fafbc5a7f36e58e18473211297540a39f..44b53fbf1969b1bf5489e4914b0f270cd255316f 100644 (file)
@@ -37,7 +37,9 @@
         <section id="var-members">
           <h2><a href="#var-members">Variables</a></h2>
           <dl class="m-dox">
-            <dt>const int <a href="#a4f9fd9cff960aeecffcab6a5d2ffcd81" class="m-dox">a</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              const int <a href="#a4f9fd9cff960aeecffcab6a5d2ffcd81" class="m-dox">a</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A value.</dd>
           </dl>
         </section>
index 895115d31527e755c54e2f18548789cc55cb80c8..0dd5cb712b33f3a351095c90d4255bf4999b2fba 100644 (file)
@@ -93,7 +93,9 @@
         <section id="pro-attribs">
           <h2><a href="#pro-attribs">Protected variables</a></h2>
           <dl class="m-dox">
-            <dt>int <a href="#aaf7ee941db121bdf57653fe4bd8f3f53" class="m-dox">a</a></dt>
+            <dt>
+              int <a href="#aaf7ee941db121bdf57653fe4bd8f3f53" class="m-dox">a</a>
+            </dt>
             <dd>Variable.</dd>
           </dl>
         </section>
index 2718105fedfbe243a711a9138e1c6fb522de0f82..3a48bde09f419d916e751e78be8728de9b4d0857 100644 (file)
@@ -97,7 +97,9 @@
         <section id="pub-static-attribs">
           <h2><a href="#pub-static-attribs">Public static variables</a></h2>
           <dl class="m-dox">
-            <dt>static int <a href="#a37f97d663491ff54fda7f9cfc3080006" class="m-dox-self" name="a37f97d663491ff54fda7f9cfc3080006">Size</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              static int <a href="#a37f97d663491ff54fda7f9cfc3080006" class="m-dox-self" name="a37f97d663491ff54fda7f9cfc3080006">Size</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A public static var.</dd>
           </dl>
         </section>
         <section id="pub-attribs">
           <h2><a href="#pub-attribs">Public variables</a></h2>
           <dl class="m-dox">
-            <dt>std::string <a href="#ad877084846b47e5504224c72aa49d399" class="m-dox-self" name="ad877084846b47e5504224c72aa49d399">debug</a></dt>
+            <dt>
+              std::string <a href="#ad877084846b47e5504224c72aa49d399" class="m-dox-self" name="ad877084846b47e5504224c72aa49d399">debug</a>
+            </dt>
             <dd>A public variable.</dd>
           </dl>
         </section>
         <section id="pro-static-attribs">
           <h2><a href="#pro-static-attribs">Protected static variables</a></h2>
           <dl class="m-dox">
-            <dt>static bool <a href="#a74e37b7c91fdbbfb8b077f96ae5e6b2f" class="m-dox-self" name="a74e37b7c91fdbbfb8b077f96ae5e6b2f">False</a></dt>
+            <dt>
+              static bool <a href="#a74e37b7c91fdbbfb8b077f96ae5e6b2f" class="m-dox-self" name="a74e37b7c91fdbbfb8b077f96ae5e6b2f">False</a>
+            </dt>
             <dd>A protected static var.</dd>
           </dl>
         </section>
         <section id="pro-attribs">
           <h2><a href="#pro-attribs">Protected variables</a></h2>
           <dl class="m-dox">
-            <dt>std::string <a href="#a7646ff8bc6f40c535eb3c281d969f8cd" class="m-dox-self" name="a7646ff8bc6f40c535eb3c281d969f8cd">logger</a></dt>
+            <dt>
+              std::string <a href="#a7646ff8bc6f40c535eb3c281d969f8cd" class="m-dox-self" name="a7646ff8bc6f40c535eb3c281d969f8cd">logger</a>
+            </dt>
             <dd>A protected variable.</dd>
           </dl>
         </section>
               using <a href="#a4a7ac6e39fedaf79a0ceb0f8d2a3cb64" class="m-dox-self" name="a4a7ac6e39fedaf79a0ceb0f8d2a3cb64">Main</a> = void <span class="m-label m-flat m-warning">protected</span>
             </dt>
             <dd>Protected alias in a group.</dd>
-            <dt>void* <a href="#a347f08e1aec78ec16125bac4c2577962" class="m-dox-self" name="a347f08e1aec78ec16125bac4c2577962">variable</a> <span class="m-label m-flat m-warning">protected</span></dt>
+            <dt>
+              void* <a href="#a347f08e1aec78ec16125bac4c2577962" class="m-dox-self" name="a347f08e1aec78ec16125bac4c2577962">variable</a> <span class="m-label m-flat m-warning">protected</span>
+            </dt>
             <dd>Protected variable in a group.</dd>
             <dt>
               <span class="m-dox-wrap-bumper">void <a href="#a829faa7cd38054a51a303027eaee3b31" class="m-dox-self" name="a829faa7cd38054a51a303027eaee3b31">foo</a>(</span><span class="m-dox-wrap">) const &amp; <span class="m-label m-flat m-warning">protected</span></span>
               using <a href="#a3ffd74e95952eacd75f04a2b85d61845" class="m-dox-self" name="a3ffd74e95952eacd75f04a2b85d61845">Float</a> = float
             </dt>
             <dd>An using declaration.</dd>
-            <dt>const int <a href="#a7708bd7aaec399e771a2b30db52e4d22" class="m-dox-self" name="a7708bd7aaec399e771a2b30db52e4d22">Var</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              const int <a href="#a7708bd7aaec399e771a2b30db52e4d22" class="m-dox-self" name="a7708bd7aaec399e771a2b30db52e4d22">Var</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A variable.</dd>
             <dt>
               <span class="m-dox-wrap-bumper">void <a href="#ac07863d69ae41a4e395b31f73b35fbcd" class="m-dox-self" name="ac07863d69ae41a4e395b31f73b35fbcd">foo</a>(</span><span class="m-dox-wrap">)</span>
index 4b44a0734041f22e9ade07577dce144d3cf0d3a4..9ec430f69a5092b2caec4961530ad5028a14356e 100644 (file)
         <section id="var-members">
           <h2><a href="#var-members">Variables</a></h2>
           <dl class="m-dox">
-            <dt>const int <a href="#acdc29819d61c01eed9c74242010a7601" class="m-dox-self" name="acdc29819d61c01eed9c74242010a7601">Var</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              const int <a href="#acdc29819d61c01eed9c74242010a7601" class="m-dox-self" name="acdc29819d61c01eed9c74242010a7601">Var</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A variable.</dd>
           </dl>
         </section>
               using <a href="#ad647ff34e255fa1b8adea19bfc55d631" class="m-dox-self" name="ad647ff34e255fa1b8adea19bfc55d631">Main</a> = void
             </dt>
             <dd>Alias in a group.</dd>
-            <dt>void* <a href="#ac4c2505beb086a985a4154d00d41de70" class="m-dox-self" name="ac4c2505beb086a985a4154d00d41de70">variable</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              void* <a href="#ac4c2505beb086a985a4154d00d41de70" class="m-dox-self" name="ac4c2505beb086a985a4154d00d41de70">variable</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>Variable in a group.</dd>
             <dt>
               <span class="m-dox-wrap-bumper">void <a href="#a0daa434b0cb806e7613bcc06ed6baaf6" class="m-dox-self" name="a0daa434b0cb806e7613bcc06ed6baaf6">bar</a>(</span><span class="m-dox-wrap">)</span>
index e253714572c1597af8c4aba20b66f7432367b56e..9376e930471a352a6c989ca7fb3a29e9c0ea9443 100644 (file)
         <section id="var-members">
           <h2><a href="#var-members">Variables</a></h2>
           <dl class="m-dox">
-            <dt>int <a href="namespaceNamespace.html#ad3121960d8665ab045ca1bfa1480a86d" class="m-dox">Variable</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              int <a href="namespaceNamespace.html#ad3121960d8665ab045ca1bfa1480a86d" class="m-dox">Variable</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A variable.</dd>
-            <dt>int <a href="namespaceNamespace.html#aa8b31b63b2a5e71fe1734212a093bdc3" class="m-dox">VariableBrief</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              int <a href="namespaceNamespace.html#aa8b31b63b2a5e71fe1734212a093bdc3" class="m-dox">VariableBrief</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>Variable with just a brief.</dd>
-            <dt>int <a href="#a7dc9e9cdaf8275ac8636d69b90f37045" class="m-dox">Variable</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              int <a href="#a7dc9e9cdaf8275ac8636d69b90f37045" class="m-dox">Variable</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A variable.</dd>
-            <dt>int <a href="#a39904e2093f37ccfc2b7ad44ead2420a" class="m-dox-self" name="a39904e2093f37ccfc2b7ad44ead2420a">VariableBrief</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              int <a href="#a39904e2093f37ccfc2b7ad44ead2420a" class="m-dox-self" name="a39904e2093f37ccfc2b7ad44ead2420a">VariableBrief</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>Variable with just a brief.</dd>
           </dl>
         </section>
index 2ee55d2f6d8e71cc1cf6f9b140665842688ed5f8..392539182ee57f0c5c4e99aa81ae9f9dfb6d8e71 100644 (file)
         <section id="var-members">
           <h2><a href="#var-members">Variables</a></h2>
           <dl class="m-dox">
-            <dt>int <a href="#ad3121960d8665ab045ca1bfa1480a86d" class="m-dox">Variable</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              int <a href="#ad3121960d8665ab045ca1bfa1480a86d" class="m-dox">Variable</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>A variable.</dd>
-            <dt>int <a href="#aa8b31b63b2a5e71fe1734212a093bdc3" class="m-dox-self" name="aa8b31b63b2a5e71fe1734212a093bdc3">VariableBrief</a> <span class="m-label m-flat m-primary">constexpr</span></dt>
+            <dt>
+              int <a href="#aa8b31b63b2a5e71fe1734212a093bdc3" class="m-dox-self" name="aa8b31b63b2a5e71fe1734212a093bdc3">VariableBrief</a> <span class="m-label m-flat m-primary">constexpr</span>
+            </dt>
             <dd>Variable with just a brief.</dd>
           </dl>
         </section>
index f266c11bb5bca0a157fd39d95c9200c62ef6292d..251d11d8342941d29a30aafb83eeda495c38a5fc 100644 (file)
@@ -55,7 +55,9 @@
         <section id="variables">
           <h2><a href="#variables">Variables</a></h2>
           <dl class="m-dox">
-            <dt>int <a href="namespaceNS.html#a0bd189dc3154c8566a9e70f94b274c33" class="m-dox">var</a></dt>
+            <dt>
+              int <a href="namespaceNS.html#a0bd189dc3154c8566a9e70f94b274c33" class="m-dox">var</a>
+            </dt>
             <dd>A variable.</dd>
           </dl>
         </section>
index 9b1fcf68722e3c7d9d720c50d0eedb2a2b055bea..aceba6d06e06b1915f48e7d6e3e743af261487e3 100644 (file)
@@ -60,7 +60,9 @@
         <section id="var-members">
           <h2><a href="#var-members">Variables</a></h2>
           <dl class="m-dox">
-            <dt>int <a href="#ac2bb0fc1fabbeabad94c3b726bd708bc" class="m-dox-self" name="ac2bb0fc1fabbeabad94c3b726bd708bc">variable</a></dt>
+            <dt>
+              int <a href="#ac2bb0fc1fabbeabad94c3b726bd708bc" class="m-dox-self" name="ac2bb0fc1fabbeabad94c3b726bd708bc">variable</a>
+            </dt>
             <dd>A variable.</dd>
           </dl>
         </section>
diff --git a/doxygen/test/cpp_variable_template/Doxyfile b/doxygen/test/cpp_variable_template/Doxyfile
new file mode 100644 (file)
index 0000000..ee1cb76
--- /dev/null
@@ -0,0 +1,14 @@
+INPUT                   = input.h
+AUTOLINK_SUPPORT        = NO
+QUIET                   = YES
+GENERATE_HTML           = NO
+GENERATE_LATEX          = NO
+GENERATE_XML            = YES
+XML_PROGRAMLISTING      = NO
+
+##! M_PAGE_FINE_PRINT   =
+##! M_THEME_COLOR       =
+##! M_FAVICON           =
+##! M_LINKS_NAVBAR1     =
+##! M_LINKS_NAVBAR2     =
+##! M_SEARCH_DISABLED   = YES
diff --git a/doxygen/test/cpp_variable_template/input.h b/doxygen/test/cpp_variable_template/input.h
new file mode 100644 (file)
index 0000000..ad12d6a
--- /dev/null
@@ -0,0 +1,23 @@
+/** @brief A non-template class */
+struct Foo {
+    /** @brief Template variable without template docs */
+    template<class T> static T* variable;
+
+    /**
+     * @brief Template variable with template docs
+     * @tparam T Well, the type
+     */
+    template<class T> static T& another;
+};
+
+/** @brief Template class */
+template<class T> struct Bar {
+    /** @brief Template variable inside a template class without template docs */
+    template<class U> static Foo<U>* instance;
+
+    /**
+     * @brief Template variable inside a template class with template docs
+     * @tparam U Well, the type
+     */
+    template<class U> static Foo<U>& another;
+};
diff --git a/doxygen/test/cpp_variable_template/structBar.html b/doxygen/test/cpp_variable_template/structBar.html
new file mode 100644 (file)
index 0000000..83533d8
--- /dev/null
@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>Bar struct | My Project</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          <div class="m-dox-template">template&lt;class T&gt;</div>
+          Bar <span class="m-thin">struct</span>
+        </h1>
+        <p>Template class.</p>
+        <div class="m-block m-default">
+          <h3>Contents</h3>
+          <ul>
+            <li>
+              Reference
+              <ul>
+                <li><a href="#pub-static-attribs">Public static variables</a></li>
+              </ul>
+            </li>
+          </ul>
+        </div>
+        <section id="pub-static-attribs">
+          <h2><a href="#pub-static-attribs">Public static variables</a></h2>
+          <dl class="m-dox">
+            <dt>
+              <div class="m-dox-template">template&lt;class U&gt;</div>
+              static <a href="structFoo.html" class="m-dox">Foo</a>&lt;U&gt;* <a href="#acbbecef244b167c48ff22c97ee2d386b" class="m-dox-self" name="acbbecef244b167c48ff22c97ee2d386b">instance</a>
+            </dt>
+            <dd>Template variable inside a template class without template docs.</dd>
+            <dt>
+              <div class="m-dox-template">template&lt;class U&gt;</div>
+              static <a href="structFoo.html" class="m-dox">Foo</a>&lt;U&gt;&amp; <a href="#a26d9727e8e3b4552618491f72fbc4143" class="m-dox">another</a>
+            </dt>
+            <dd>Template variable inside a template class with template docs.</dd>
+          </dl>
+        </section>
+        <section>
+          <h2>Variable documentation</h2>
+          <section class="m-dox-details" id="a26d9727e8e3b4552618491f72fbc4143"><div>
+            <h3>
+              <div class="m-dox-template">
+                template&lt;class T&gt;
+                template&lt;class U&gt;
+              </div>
+              static <a href="structFoo.html" class="m-dox">Foo</a>&lt;U&gt;&amp; Bar&lt;T&gt;::<wbr /><a href="#a26d9727e8e3b4552618491f72fbc4143" class="m-dox-self">another</a>
+            </h3>
+            <p>Template variable inside a template class with template docs.</p>
+            <table class="m-table m-fullwidth m-flat">
+              <thead>
+                <tr><th colspan="2">Template parameters</th></tr>
+              </thead>
+              <tbody>
+                <tr>
+                  <td style="width: 1%">U</td>
+                  <td>Well, the type</td>
+                </tr>
+              </tbody>
+            </table>
+          </div></section>
+        </section>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
diff --git a/doxygen/test/cpp_variable_template/structFoo.html b/doxygen/test/cpp_variable_template/structFoo.html
new file mode 100644 (file)
index 0000000..d123ffc
--- /dev/null
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8" />
+  <title>Foo struct | My Project</title>
+  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600" />
+  <link rel="stylesheet" href="m-dark+doxygen.compiled.css" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+</head>
+<body>
+<header><nav id="navigation">
+  <div class="m-container">
+    <div class="m-row">
+      <a href="index.html" id="m-navbar-brand" class="m-col-t-8 m-col-m-none m-left-m">My Project</a>
+    </div>
+  </div>
+</nav></header>
+<main><article>
+  <div class="m-container m-container-inflatable">
+    <div class="m-row">
+      <div class="m-col-l-10 m-push-l-1">
+        <h1>
+          Foo <span class="m-thin">struct</span>
+        </h1>
+        <p>A non-template class.</p>
+        <div class="m-block m-default">
+          <h3>Contents</h3>
+          <ul>
+            <li>
+              Reference
+              <ul>
+                <li><a href="#pub-static-attribs">Public static variables</a></li>
+              </ul>
+            </li>
+          </ul>
+        </div>
+        <section id="pub-static-attribs">
+          <h2><a href="#pub-static-attribs">Public static variables</a></h2>
+          <dl class="m-dox">
+            <dt>
+              <div class="m-dox-template">template&lt;class T&gt;</div>
+              static T* <a href="#a5610f0877922663122345b4ea6b987eb" class="m-dox-self" name="a5610f0877922663122345b4ea6b987eb">variable</a>
+            </dt>
+            <dd>Template variable without template docs.</dd>
+            <dt>
+              <div class="m-dox-template">template&lt;class T&gt;</div>
+              static T&amp; <a href="#afa3d6e8f346fdea749ed8a9f8b0bebcd" class="m-dox">another</a>
+            </dt>
+            <dd>Template variable with template docs.</dd>
+          </dl>
+        </section>
+        <section>
+          <h2>Variable documentation</h2>
+          <section class="m-dox-details" id="afa3d6e8f346fdea749ed8a9f8b0bebcd"><div>
+            <h3>
+              <div class="m-dox-template">
+                template&lt;class T&gt;
+              </div>
+              static T&amp; Foo::<wbr /><a href="#afa3d6e8f346fdea749ed8a9f8b0bebcd" class="m-dox-self">another</a>
+            </h3>
+            <p>Template variable with template docs.</p>
+            <table class="m-table m-fullwidth m-flat">
+              <thead>
+                <tr><th colspan="2">Template parameters</th></tr>
+              </thead>
+              <tbody>
+                <tr>
+                  <td style="width: 1%">T</td>
+                  <td>Well, the type</td>
+                </tr>
+              </tbody>
+            </table>
+          </div></section>
+        </section>
+      </div>
+    </div>
+  </div>
+</article></main>
+</body>
+</html>
index 5bab4020d4d9b986aee40dee4e39b65e900dfecc..6e6504b13498c614083b3d6dc4f314e6c8cbd23a 100644 (file)
@@ -80,3 +80,12 @@ class SignalsSlots(IntegrationTestCase):
     def test(self):
         self.run_dox2html5(wildcard='classClass.xml')
         self.assertEqual(*self.actual_expected_contents('classClass.html'))
+
+class VariableTemplate(IntegrationTestCase):
+    def __init__(self, *args, **kwargs):
+        super().__init__(__file__, 'variable_template', *args, **kwargs)
+
+    def test(self):
+        self.run_dox2html5(wildcard='*.xml')
+        self.assertEqual(*self.actual_expected_contents('structFoo.html'))
+        self.assertEqual(*self.actual_expected_contents('structBar.html'))