diff --git a/docs/modules/ROOT/pages/generators.adoc b/docs/modules/ROOT/pages/generators.adoc index 1592c45d3..94f711059 100644 --- a/docs/modules/ROOT/pages/generators.adoc +++ b/docs/modules/ROOT/pages/generators.adoc @@ -438,14 +438,18 @@ When the symbol kind is `variable`, the symbol object has the following addition | `<>` | The template information of the variable. -| `constexprKind` -| `string` -| The constexpr kind of the variable (e.g., `consteval`, `constexpr`). - | `storageClass` | `string` | The storage class of the variable (e.g., `static`, `extern`). +| `isInline` +| `bool` +| Whether the variable is `inline`. + +| `isConstexpr` +| `bool` +| Whether the variable is `constexpr`. + | `isConstinit` | `bool` | Whether the variable is `constinit`. @@ -457,6 +461,10 @@ When the symbol kind is `variable`, the symbol object has the following addition | `initializer` | `string` | The initializer of the variable. + +| `attributes` +| `string[]` +| The attributes of the variable. |=== When the symbol kind is `field` (i.e. non-static data members), the symbol object has the following additional properties: diff --git a/include/mrdocs/Metadata/Variable.hpp b/include/mrdocs/Metadata/Variable.hpp index b4069aa4d..af0f21c62 100644 --- a/include/mrdocs/Metadata/Variable.hpp +++ b/include/mrdocs/Metadata/Variable.hpp @@ -40,12 +40,16 @@ struct VariableInfo StorageClassKind StorageClass = StorageClassKind::None; - ConstexprKind Constexpr = ConstexprKind::None; + bool IsInline = false; + + bool IsConstexpr = false; bool IsConstinit = false; bool IsThreadLocal = false; + std::vector Attributes; + //-------------------------------------------- explicit VariableInfo(SymbolID ID) noexcept diff --git a/share/mrdocs/addons/generator/common/partials/symbol/signature/variable.hbs b/share/mrdocs/addons/generator/common/partials/symbol/signature/variable.hbs index 5fd8e22b7..77caeb6a1 100644 --- a/share/mrdocs/addons/generator/common/partials/symbol/signature/variable.hbs +++ b/share/mrdocs/addons/generator/common/partials/symbol/signature/variable.hbs @@ -1,7 +1,7 @@ {{#if template}}{{>template/head template}} {{/if~}} -{{#if constexprKind}}{{constexprKind}} -{{/if~}} +{{#if isInline}}inline {{/if~}} +{{#if isConstexpr}}constexpr {{/if~}} {{#if storageClass}}{{storageClass}} {{/if~}} {{#if isThreadLocal}}thread_local diff --git a/src/lib/AST/ASTVisitor.cpp b/src/lib/AST/ASTVisitor.cpp index 1416a3e3e..54e5b6fbe 100644 --- a/src/lib/AST/ASTVisitor.cpp +++ b/src/lib/AST/ASTVisitor.cpp @@ -1192,15 +1192,20 @@ populate( // it is possible to declare a static data member // as both constexpr and constinit in separate declarations.. I.IsConstinit |= D->hasAttr(); - if (D->isConstexpr()) - { - I.Constexpr = ConstexprKind::Constexpr; - } + I.IsConstexpr |= D->isConstexpr(); + I.IsInline |= D->isInline(); if (Expr const* E = D->getInit()) { populate(I.Initializer, E); } - I.Type = toTypeInfo(D->getType()); + auto QT = D->getType(); + if (D->isConstexpr()) { + // when D->isConstexpr() is true, QT contains a redundant + // `const` qualifier which we need to remove + QT.removeLocalConst(); + } + I.Type = toTypeInfo(QT); + populateAttributes(I, D); } void diff --git a/src/lib/Gen/xml/XMLWriter.cpp b/src/lib/Gen/xml/XMLWriter.cpp index bdc783e68..5b99a34ea 100644 --- a/src/lib/Gen/xml/XMLWriter.cpp +++ b/src/lib/Gen/xml/XMLWriter.cpp @@ -598,7 +598,8 @@ writeVariable( writeSourceInfo(I); writeAttr(I.StorageClass, "storage-class", tags_); - writeAttr(I.Constexpr, "constexpr-kind", tags_); + writeAttr(I.IsInline, "is-inline", tags_); + writeAttr(I.IsConstexpr, "is-constexpr", tags_); writeAttr(I.IsConstinit, "is-constinit", tags_); writeAttr(I.IsThreadLocal, "is-thread-local", tags_); diff --git a/src/lib/Metadata/Info.cpp b/src/lib/Metadata/Info.cpp index 75b15b7bc..6b9a37c31 100644 --- a/src/lib/Metadata/Info.cpp +++ b/src/lib/Metadata/Info.cpp @@ -189,22 +189,22 @@ tag_invoke( } if constexpr (T::isVariable()) { - io.map("type", I.Type); - io.map("template", I.Template); - if (I.Constexpr != ConstexprKind::None) - { - io.map("constexprKind", I.Constexpr); - } - if (I.StorageClass != StorageClassKind::None) + auto const& U = static_cast(I); + io.map("type", U.Type); + io.map("template", U.Template); + if (U.StorageClass != StorageClassKind::None) { - io.map("storageClass", I.StorageClass); + io.map("storageClass", U.StorageClass); } - io.map("isConstinit", I.IsConstinit); - io.map("isThreadLocal", I.IsThreadLocal); - if (!I.Initializer.Written.empty()) + io.map("isInline", U.IsInline); + io.map("isConstexpr", U.IsConstexpr); + io.map("isConstinit", U.IsConstinit); + io.map("isThreadLocal", U.IsThreadLocal); + if (!U.Initializer.Written.empty()) { - io.map("initializer", I.Initializer.Written); + io.map("initializer", U.Initializer.Written); } + io.map("attributes", dom::LazyArray(U.Attributes)); } if constexpr (T::isField()) { diff --git a/src/lib/Metadata/Reduce.cpp b/src/lib/Metadata/Reduce.cpp index c8a124076..8f58d6af1 100644 --- a/src/lib/Metadata/Reduce.cpp +++ b/src/lib/Metadata/Reduce.cpp @@ -325,11 +325,19 @@ void merge(VariableInfo& I, VariableInfo&& Other) I.IsConstinit |= Other.IsConstinit; I.IsThreadLocal |= Other.IsThreadLocal; - - if(I.Constexpr == ConstexprKind::None) - I.Constexpr = Other.Constexpr; - if(I.StorageClass == StorageClassKind::None) + I.IsConstexpr |= Other.IsConstexpr; + I.IsInline |= Other.IsInline; + if (I.StorageClass == StorageClassKind::None) + { I.StorageClass = Other.StorageClass; + } + for (auto& otherAttr: Other.Attributes) + { + if (std::ranges::find(I.Attributes, otherAttr) == I.Attributes.end()) + { + I.Attributes.push_back(otherAttr); + } + } } void merge(SpecializationInfo& I, SpecializationInfo&& Other) diff --git a/test-files/golden-tests/filters/symbol-name/impl-defined-member.adoc b/test-files/golden-tests/filters/symbol-name/impl-defined-member.adoc index ef8bb4fa4..fb3438743 100644 --- a/test-files/golden-tests/filters/symbol-name/impl-defined-member.adoc +++ b/test-files/golden-tests/filters/symbol-name/impl-defined-member.adoc @@ -64,8 +64,7 @@ Declared in `<impl‐defined‐member.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -/* implementation-defined */ const absolute_uri_rule = {}; +constexpr /* implementation-defined */ absolute_uri_rule = {}; ---- [#regular_absolute_uri_rule] @@ -79,8 +78,7 @@ Declared in `<impl‐defined‐member.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -<>::<> const regular_absolute_uri_rule = {}; +constexpr <>::<> regular_absolute_uri_rule = {}; ---- diff --git a/test-files/golden-tests/filters/symbol-name/impl-defined-member.html b/test-files/golden-tests/filters/symbol-name/impl-defined-member.html index fb6a7cb4f..1ed58284e 100644 --- a/test-files/golden-tests/filters/symbol-name/impl-defined-member.html +++ b/test-files/golden-tests/filters/symbol-name/impl-defined-member.html @@ -79,8 +79,7 @@

Synopsis

Declared in <impl-defined-member.cpp>
 
-constexpr
-/* implementation-defined */ const absolute_uri_rule = {};
+constexpr /* implementation-defined */ absolute_uri_rule = {};
 
 
@@ -95,8 +94,7 @@

Synopsis

Declared in <impl-defined-member.cpp>
 
-constexpr
-regular::absolute_uri_rule_t const regular_absolute_uri_rule = {};
+constexpr regular::absolute_uri_rule_t regular_absolute_uri_rule = {};
 
 
diff --git a/test-files/golden-tests/filters/symbol-name/impl-defined-member.xml b/test-files/golden-tests/filters/symbol-name/impl-defined-member.xml index 692a10746..520ddba86 100644 --- a/test-files/golden-tests/filters/symbol-name/impl-defined-member.xml +++ b/test-files/golden-tests/filters/symbol-name/impl-defined-member.xml @@ -14,13 +14,13 @@ - - + + - - + + diff --git a/test-files/golden-tests/metadata/ns-variables.adoc b/test-files/golden-tests/metadata/ns-variables.adoc index d1b059ecf..3fb5c55f4 100644 --- a/test-files/golden-tests/metadata/ns-variables.adoc +++ b/test-files/golden-tests/metadata/ns-variables.adoc @@ -58,8 +58,7 @@ Declared in `<ns‐variables.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -int const i = 0; +constexpr int i = 0; ---- [#j] @@ -87,9 +86,8 @@ Declared in `<ns‐variables.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -extern -int const k = 1; +constexpr extern +int k = 1; ---- [#l] @@ -178,10 +176,9 @@ Declared in `<ns‐variables.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -static +constexpr static thread_local -int const x2 = 0; +int x2 = 0; ---- diff --git a/test-files/golden-tests/metadata/ns-variables.html b/test-files/golden-tests/metadata/ns-variables.html index 51ae20c1b..5373a9c34 100644 --- a/test-files/golden-tests/metadata/ns-variables.html +++ b/test-files/golden-tests/metadata/ns-variables.html @@ -69,8 +69,7 @@

Synopsis

Declared in <ns-variables.cpp>
 
-constexpr
-int const i = 0;
+constexpr int i = 0;
 
 
@@ -100,9 +99,8 @@

Synopsis

Declared in <ns-variables.cpp>
 
-constexpr
-extern
-int const k = 1;
+constexpr extern
+int k = 1;
 
 
@@ -197,10 +195,9 @@

Synopsis

Declared in <ns-variables.cpp>
 
-constexpr
-static
+constexpr static
 thread_local
-int const x2 = 0;
+int x2 = 0;
 
 
diff --git a/test-files/golden-tests/metadata/ns-variables.xml b/test-files/golden-tests/metadata/ns-variables.xml index 75271055e..70302edcb 100644 --- a/test-files/golden-tests/metadata/ns-variables.xml +++ b/test-files/golden-tests/metadata/ns-variables.xml @@ -4,8 +4,8 @@ - - + + @@ -16,8 +16,8 @@ - - + + @@ -52,9 +52,9 @@ - + - + diff --git a/test-files/golden-tests/metadata/static-data-def-constexpr.adoc b/test-files/golden-tests/metadata/static-data-def-constexpr.adoc index 6f3d1cc17..7f2af620d 100644 --- a/test-files/golden-tests/metadata/static-data-def-constexpr.adoc +++ b/test-files/golden-tests/metadata/static-data-def-constexpr.adoc @@ -51,9 +51,8 @@ Declared in `<static‐data‐def‐constexpr.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -static -<> const s = S{}; +inline constexpr static +<> s = S{}; ---- [#T] @@ -92,9 +91,8 @@ Declared in `<static‐data‐def‐constexpr.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -static -int const t = 0; +inline constexpr static +int t = 0; ---- diff --git a/test-files/golden-tests/metadata/static-data-def-constexpr.html b/test-files/golden-tests/metadata/static-data-def-constexpr.html index 5ca5a5afc..339def123 100644 --- a/test-files/golden-tests/metadata/static-data-def-constexpr.html +++ b/test-files/golden-tests/metadata/static-data-def-constexpr.html @@ -62,9 +62,8 @@

Synopsis

Declared in <static-data-def-constexpr.cpp>
 
-constexpr
-static
-S const s = S{};
+inline constexpr static
+S s = S{};
 
 
@@ -108,9 +107,8 @@

Synopsis

Declared in <static-data-def-constexpr.cpp>
 
-constexpr
-static
-int const t = 0;
+inline constexpr static
+int t = 0;
 
 
diff --git a/test-files/golden-tests/metadata/static-data-def-constexpr.xml b/test-files/golden-tests/metadata/static-data-def-constexpr.xml index d22dac21e..784f88309 100644 --- a/test-files/golden-tests/metadata/static-data-def-constexpr.xml +++ b/test-files/golden-tests/metadata/static-data-def-constexpr.xml @@ -8,8 +8,9 @@ - - + + + @@ -18,9 +19,10 @@ - + + - + diff --git a/test-files/golden-tests/metadata/static-data-def.adoc b/test-files/golden-tests/metadata/static-data-def.adoc index db48573a2..6c89c64c9 100644 --- a/test-files/golden-tests/metadata/static-data-def.adoc +++ b/test-files/golden-tests/metadata/static-data-def.adoc @@ -82,7 +82,7 @@ Declared in `<static‐data‐def.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -static +inline static int v1 = 1; ---- @@ -97,9 +97,8 @@ Declared in `<static‐data‐def.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -static -int const v2 = 2; +inline constexpr static +int v2 = 2; ---- [#A-v3] @@ -113,7 +112,7 @@ Declared in `<static‐data‐def.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -static +inline static int const v3 = 3; ---- @@ -143,7 +142,7 @@ Declared in `<static‐data‐def.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -static +inline static int v5 = 5; ---- @@ -158,7 +157,7 @@ Declared in `<static‐data‐def.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -static +inline static int const v6 = 6; ---- @@ -173,9 +172,8 @@ Declared in `<static‐data‐def.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -static -int const v7 = 7; +inline constexpr static +int v7 = 7; ---- [#B] @@ -231,10 +229,9 @@ Declared in `<static‐data‐def.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- -constexpr -static +inline constexpr static thread_local -int const x1 = 0; +int x1 = 0; ---- [#f] diff --git a/test-files/golden-tests/metadata/static-data-def.html b/test-files/golden-tests/metadata/static-data-def.html index 746ffe5c9..86ff27203 100644 --- a/test-files/golden-tests/metadata/static-data-def.html +++ b/test-files/golden-tests/metadata/static-data-def.html @@ -98,7 +98,7 @@

Synopsis

Declared in <static-data-def.cpp>
 
-static
+inline static
 int v1 = 1;
 
 
@@ -114,9 +114,8 @@

Synopsis

Declared in <static-data-def.cpp>
 
-constexpr
-static
-int const v2 = 2;
+inline constexpr static
+int v2 = 2;
 
 
@@ -131,7 +130,7 @@

Synopsis

Declared in <static-data-def.cpp>
 
-static
+inline static
 int const v3 = 3;
 
 
@@ -163,7 +162,7 @@

Synopsis

Declared in <static-data-def.cpp>
 
-static
+inline static
 int v5 = 5;
 
 
@@ -179,7 +178,7 @@

Synopsis

Declared in <static-data-def.cpp>
 
-static
+inline static
 int const v6 = 6;
 
 
@@ -195,9 +194,8 @@

Synopsis

Declared in <static-data-def.cpp>
 
-constexpr
-static
-int const v7 = 7;
+inline constexpr static
+int v7 = 7;
 
 
@@ -259,10 +257,9 @@

Synopsis

Declared in <static-data-def.cpp>
 
-constexpr
-static
+inline constexpr static
 thread_local
-int const x1 = 0;
+int x1 = 0;
 
 
diff --git a/test-files/golden-tests/metadata/static-data-def.xml b/test-files/golden-tests/metadata/static-data-def.xml index 79fe1c65c..015773fd0 100644 --- a/test-files/golden-tests/metadata/static-data-def.xml +++ b/test-files/golden-tests/metadata/static-data-def.xml @@ -16,19 +16,22 @@ + - - + + + + @@ -40,18 +43,21 @@ + + - - + + + @@ -67,9 +73,10 @@ - + + - + diff --git a/test-files/golden-tests/metadata/static-data-template.adoc b/test-files/golden-tests/metadata/static-data-template.adoc index 0928dc824..4ee119fb1 100644 --- a/test-files/golden-tests/metadata/static-data-template.adoc +++ b/test-files/golden-tests/metadata/static-data-template.adoc @@ -56,9 +56,8 @@ Declared in `<static‐data‐template.cpp>` template< typename U, typename V> -constexpr -static -T const x = 0; +inline constexpr static +T x = 0; ---- [#A-x-0a] @@ -73,9 +72,8 @@ Declared in `<static‐data‐template.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename U> -constexpr -static -T const x<U*, T> = 1; +inline constexpr static +T x<U*, T> = 1; ---- [#A-x-07] @@ -90,9 +88,8 @@ Declared in `<static‐data‐template.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> -constexpr -static -bool const x<T, long> = 2; +inline constexpr static +bool x<T, long> = 2; ---- diff --git a/test-files/golden-tests/metadata/static-data-template.html b/test-files/golden-tests/metadata/static-data-template.html index 38e1f6fd8..ef681642f 100644 --- a/test-files/golden-tests/metadata/static-data-template.html +++ b/test-files/golden-tests/metadata/static-data-template.html @@ -67,9 +67,8 @@

Synopsis

template< typename U, typename V> -constexpr -static -T const x = 0; +inline constexpr static +T x = 0; @@ -85,9 +84,8 @@

Synopsis

 
 template<typename U>
-constexpr
-static
-T const x<U*, T> = 1;
+inline constexpr static
+T x<U*, T> = 1;
 
 
@@ -103,9 +101,8 @@

Synopsis

 
 template<>
-constexpr
-static
-bool const x<T, long> = 2;
+inline constexpr static
+bool x<T, long> = 2;
 
 
diff --git a/test-files/golden-tests/metadata/static-data-template.xml b/test-files/golden-tests/metadata/static-data-template.xml index aab81791b..23e3580a0 100644 --- a/test-files/golden-tests/metadata/static-data-template.xml +++ b/test-files/golden-tests/metadata/static-data-template.xml @@ -12,8 +12,9 @@ - - + + + diff --git a/test-files/golden-tests/metadata/var-inline-constexpr.adoc b/test-files/golden-tests/metadata/var-inline-constexpr.adoc new file mode 100644 index 000000000..1349b4239 --- /dev/null +++ b/test-files/golden-tests/metadata/var-inline-constexpr.adoc @@ -0,0 +1,173 @@ += Reference +:mrdocs: + +[#index] +== Global namespace + + +=== Variables + +[cols=1] +|=== +| Name + +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +| <> +|=== + +[#var] +== var + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +int var = 5; +---- + +[#var_const] +== var_const + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +int const var_const = 4; +---- + +[#var_const_t] +== var_const_t + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +T const var_const_t; +---- + +[#var_constexpr] +== var_constexpr + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +constexpr int var_constexpr = 2; +---- + +[#var_constexpr_t] +== var_constexpr_t + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +constexpr T var_constexpr_t; +---- + +[#var_inline_const] +== var_inline_const + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +inline int const var_inline_const = 3; +---- + +[#var_inline_const_t] +== var_inline_const_t + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +inline T const var_inline_const_t; +---- + +[#var_inline_constexpr] +== var_inline_constexpr + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +inline constexpr int var_inline_constexpr = 1; +---- + +[#var_inline_constexpr_t] +== var_inline_constexpr_t + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +inline constexpr T var_inline_constexpr_t; +---- + +[#var_t] +== var_t + + +=== Synopsis + + +Declared in `<var‐inline‐constexpr.cpp>` + +[source,cpp,subs="verbatim,replacements,macros,-callouts"] +---- +template<class T> +T var_t; +---- + + + +[.small]#Created with https://www.mrdocs.com[MrDocs]# diff --git a/test-files/golden-tests/metadata/var-inline-constexpr.cpp b/test-files/golden-tests/metadata/var-inline-constexpr.cpp new file mode 100644 index 000000000..ab900d4ba --- /dev/null +++ b/test-files/golden-tests/metadata/var-inline-constexpr.cpp @@ -0,0 +1,25 @@ +inline constexpr int var_inline_constexpr = 1; + +constexpr int var_constexpr = 2; + +inline const int var_inline_const = 3; + +const int var_const = 4; + +int var = 5; + +template +inline constexpr T var_inline_constexpr_t; + +template +constexpr T var_constexpr_t; + +template +inline const T var_inline_const_t; + +template +const T var_const_t; + +template +T var_t; + diff --git a/test-files/golden-tests/metadata/var-inline-constexpr.html b/test-files/golden-tests/metadata/var-inline-constexpr.html new file mode 100644 index 000000000..55fdbf003 --- /dev/null +++ b/test-files/golden-tests/metadata/var-inline-constexpr.html @@ -0,0 +1,195 @@ + + +Reference + + +
+

Reference

+
+
+

Global namespace

+
+

Variables

+ + + + + + + + + + + + + + + + + + + +
Name
var
var_const
var_const_t
var_constexpr
var_constexpr_t
var_inline_const
var_inline_const_t
var_inline_constexpr
var_inline_constexpr_t
var_t
+
+
+
+

var

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+int var = 5;
+
+
+
+
+
+
+

var_const

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+int const var_const = 4;
+
+
+
+
+
+
+

var_const_t

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+template<class T>
+T const var_const_t;
+
+
+
+
+
+
+

var_constexpr

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+constexpr int var_constexpr = 2;
+
+
+
+
+
+
+

var_constexpr_t

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+template<class T>
+constexpr T var_constexpr_t;
+
+
+
+
+
+
+

var_inline_const

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+inline int const var_inline_const = 3;
+
+
+
+
+
+
+

var_inline_const_t

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+template<class T>
+inline T const var_inline_const_t;
+
+
+
+
+
+
+

var_inline_constexpr

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+inline constexpr int var_inline_constexpr = 1;
+
+
+
+
+
+
+

var_inline_constexpr_t

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+template<class T>
+inline constexpr T var_inline_constexpr_t;
+
+
+
+
+
+
+

var_t

+
+
+

Synopsis

+
+Declared in <var-inline-constexpr.cpp>
+
+
+template<class T>
+T var_t;
+
+
+
+
+ +
+
+

Created with MrDocs

+
+ + \ No newline at end of file diff --git a/test-files/golden-tests/metadata/var-inline-constexpr.xml b/test-files/golden-tests/metadata/var-inline-constexpr.xml new file mode 100644 index 000000000..e87f5b9db --- /dev/null +++ b/test-files/golden-tests/metadata/var-inline-constexpr.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test-files/golden-tests/metadata/var-template.adoc b/test-files/golden-tests/metadata/var-template.adoc index 17c01e73c..bac7195a0 100644 --- a/test-files/golden-tests/metadata/var-template.adoc +++ b/test-files/golden-tests/metadata/var-template.adoc @@ -63,7 +63,7 @@ Declared in `<var‐template.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -static +inline static unsigned int C = 0; ---- @@ -79,7 +79,7 @@ Declared in `<var‐template.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> -static +inline static unsigned int C<int> = ‐1; ---- @@ -95,7 +95,7 @@ Declared in `<var‐template.cpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename T> -static +inline static unsigned int C<T*> = sizeof(T); ---- diff --git a/test-files/golden-tests/metadata/var-template.html b/test-files/golden-tests/metadata/var-template.html index f6252239a..94ab5fa9c 100644 --- a/test-files/golden-tests/metadata/var-template.html +++ b/test-files/golden-tests/metadata/var-template.html @@ -78,7 +78,7 @@

Synopsis

 
 template<typename T>
-static
+inline static
 unsigned int C = 0;
 
 
@@ -95,7 +95,7 @@

Synopsis

 
 template<>
-static
+inline static
 unsigned int C<int> = -1;
 
 
@@ -112,7 +112,7 @@

Synopsis

 
 template<typename T>
-static
+inline static
 unsigned int C<T*> = sizeof(T);
 
 
diff --git a/test-files/golden-tests/metadata/var-template.xml b/test-files/golden-tests/metadata/var-template.xml index 23acd786c..b651d6287 100644 --- a/test-files/golden-tests/metadata/var-template.xml +++ b/test-files/golden-tests/metadata/var-template.xml @@ -31,6 +31,7 @@ + @@ -39,6 +40,7 @@ + @@ -48,6 +50,7 @@ +