Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/cxx-api/parser/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def get_variable_member(
if initializer_type == InitializerType.BRACE:
is_brace_initializer = True

return VariableMember(
member = VariableMember(
variable_name,
variable_type,
visibility,
Expand All @@ -263,6 +263,10 @@ def get_variable_member(
is_brace_initializer,
)

member.add_template(get_template_params(member_def))

return member


def get_doxygen_params(
function_def: compound.MemberdefType,
Expand Down
3 changes: 3 additions & 0 deletions scripts/cxx-api/parser/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ def to_string(

result = " " * indent

if self.template_list is not None:
result += self.template_list.to_string() + "\n" + " " * indent

if not hide_visibility:
result += self.visibility + " "

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
template <typename T>
const test::Strct<T> test::Strct<T>::VALUE;

template <typename T>
struct test::Strct {
public static const test::Strct<T> VALUE;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#pragma once

namespace test {

template <typename T>
struct Strct {
static const Strct<T> VALUE;
};

template <typename T>
const Strct<T> Strct<T>::VALUE = {};

} // namespace test
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
constexpr T test::default_value;
constexpr test::MyType test::default_value<test::MyType>;
template <typename T>
constexpr T test::default_value;
template <typename T>
T* test::null_ptr;
test::MyType* test::null_ptr<test::MyType>;

Expand Down
Loading