8000 RTTR_ENABLE fails ontemplate<size_t V> · Issue #382 · rttrorg/rttr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RTTR_ENABLE fails ontemplate<size_t V> #382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
obfuscate opened this issue Apr 10, 2025 · 3 comments
Open

RTTR_ENABLE fails ontemplate<size_t V> #382

obfuscate opened this issue Apr 10, 2025 · 3 comments

Comments

@obfuscate
Copy link
< 8000 p dir="auto">Hello there!

I've faced with a strange error during compilation this code:

class Test0
{
public:
	RTTR_ENABLE()
};

template<std::size_t _Order>
class Test1 : public Test0
{
public:
	RTTR_ENABLE(Test0)
};

And compiler says:

1>rttr\template_type_trait_impl.h(135,1): error C2672: 'rttr::type::get': no matching overloaded function found
1>(compiling source file 'test_cpp.cpp')
1>    \rttr\type.h(323,32):
1>    could be 'rttr::type rttr::type::get(T &&) noexcept'
1>        test_cpp.cpp(27,28):
1>        'rttr::type::get': invalid template argument for 'T', type expected
1>    rttr\type.h(310,32):
1>    or       'rttr::type rttr::type::get(void) noexcept'
1>        test_cpp.cpp(27,28):
1>        'rttr::type::get': invalid template argument for 'T', type expected
1>    rttr\detail\misc\template_type_trait_impl.h(135,1):
1>    the template instantiation context (the oldest one first) is
1>        asic_ecs_module.cpp(27,22):
1>        see reference to class template instantiation 'Test1<10000>' being compiled
1>        test_cpp.cpp(24,2):
1>        while compiling class template member function 'rttr::detail::derived_info Test1<10000>::get_derived_info(void)'
1>        test_cpp.cpp(24,2):
1>        see reference to function template instantiation 'rttr::type rttr::detail::get_type_from_instance<Test1<10000>>(const T *) noexcept' being compiled
1>        with
1>        [
1>            T=Test1<10000>
1>        ]
1>        rttr\detail\type\type_impl.h(325,20):
1>        see reference to function template instantiation 'rttr::type rttr::detail::create_or_get_type<Test1<10000>>(void) noexcept' being compiled
1>        rttr\detail\type\type_impl.h(304,77):
1>        see reference to function template instantiation 'std::unique_ptr<rttr::detail::type_data,std::default_delete<rttr::detail::type_data>> rttr::detail::make_type_data<Test1<10000>>(void)' being compiled
1>        rttr\detail\type\type_data.h(330,47):
1>        see reference to class template instantiation 'rttr::detail::template_type_trait<Test1<10000>>' being compiled
1>        rttr\detail\misc\template_type_trait_impl.h(135,1):
1>        while compiling class template member function 'std::vector<rttr::type,std::allocator<rttr::type>> rttr::detail::template_type_trait<Test1<10000>>::get_template_arguments(void)'
1>            rttr\detail\type\type_data.h(300,14):
1>            see the first reference to 'rttr::detail::template_type_trait<Test1<10000>>::get_template_arguments' in 'rttr::detail::make_type_data'
1>            rttr\detail\type\type_impl.h(304,77):
1>            see the first reference to 'rttr::detail::make_type_data' in 'rttr::detail::create_or_get_type'
1>            rttr\detail\type\type_impl.h(325,20):
1>            see the first reference to 'rttr::detail::create_or_get_type' in 'rttr::detail::get_type_from_instance'
1>            test_cpp.cpp(24,2):
1>            see the first reference to 'rttr::detail::get_type_from_instance' in 'Test1<10000>::get_derived_info'

but If I change the test1 like this:

template<typename T, T _Order>
class Test1 : public Test0
{
public:
	RTTR_ENABLE(Test0)
};

Everything compiles fine.

Do you have any idea what is wrong with the first code?

@acki-m
Copy link
Contributor
acki-m commented Apr 10, 2025

I can say, it compiles with my version gcc 12 & c++17
But I updated some third party deps, but not on RTTR itself.
Which compiler do you use?

@obfuscate
Copy link
Author
obfuscate commented Apr 10, 2025

msvc 1943 (toolset v143), c++20

@obfuscate
Copy link
Author

Any updates/thoughts?
@acki-m may be you had a chance to look at it?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0