Skip to content
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

Fix problems related to using-based function references (C++ 20) #538

Closed
wants to merge 1 commit into from

Conversation

josephbirkner
Copy link

@josephbirkner josephbirkner commented Nov 20, 2023

The previous way in which using was used to declare the typeInfo function for each builtin reflectable does not seem to be understood by MSVC 2019 (19.29.30146.0).

This is just the start of the error messages I was seeing during compilation for each usage of a typeInfo function:

[1/442] Building CXX object libs\livesource\CMakeFiles\livesource.dir\ndsliveapi_for_datalayers.zserio-gen\nds\adas\v2022_04\properties\Properties.cpp.obj
D:\code\mapget-datasource-live\cmake-build-release\_deps\zseriocppruntime-src\compiler\extensions\cpp\runtime\src\zserio/Reflectable.h(283): error C2064: term does not evaluate to a function taking 0 arguments
D:\code\mapget-datasource-live\cmake-build-release\_deps\zseriocppruntime-src\compiler\extensions\cpp\runtime\src\zserio/Reflectable.h(283): note: 'typeInfo': function declaration must be available as none of the arguments depend on a template parameter
D:\code\mapget-datasource-live\cmake-build-release\_deps\zseriocppruntime-src\compiler\extensions\cpp\runtime\src\zserio/Reflectable.h(300): note: see reference to class template instantiation 'zserio::BoolReflectable<ALLOC>' being compiled
...

UPDATE: This problem appears only when compiling with C++ 20 standard enabled.

@mikir
Copy link
Contributor

mikir commented Nov 24, 2023

This PR will be solved within scope of issue #544.

@mikir mikir closed this Nov 24, 2023
@mikir mikir reopened this Nov 24, 2023
@josephbirkner
Copy link
Author

josephbirkner commented Nov 24, 2023

Ok, then we can close this for now. I hope that the problem is really MSVC 2019, lets see.

@josephbirkner josephbirkner changed the title Fix problems related to using-based function references Fix problems related to using-based function references (C++ 20) Dec 12, 2023
@josephbirkner
Copy link
Author

Update: The issue appears only when compiling with C++ 20 standard enabled.

@josephbirkner josephbirkner force-pushed the bugfix/msvc-19-reflectable branch 3 times, most recently from 500f322 to 2060042 Compare December 12, 2023 12:06
@josephbirkner josephbirkner force-pushed the bugfix/msvc-19-reflectable branch from 2060042 to 0e462bc Compare December 12, 2023 12:14
Mi-La added a commit that referenced this pull request Dec 12, 2023
Implement typeInfo static function without use of auto in Reflectable.h.
@Mi-La
Copy link
Contributor

Mi-La commented Dec 12, 2023

Hopefully fixed on master by commit 0e53b4d

@josephbirkner
Copy link
Author

Thanks! Do you generally not accept PRs? Then it would be good to mention that somewhere.

@josephbirkner josephbirkner deleted the bugfix/msvc-19-reflectable branch December 12, 2023 16:32
@Mi-La
Copy link
Contributor

Mi-La commented Dec 12, 2023

I was already working on it when you pushed your changes today.
In general we would probably accept a PR, but it's often easier just to get inspired by it :-).

We have also a plan to provide some PR rules/howto, since we are quite paranoid about coding style (which is also not officially defined :-)).

@mikir mikir added bug Something isn't working c++ C++ language generator labels Dec 14, 2023
@mikir mikir added this to the 2.13 milestone Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c++ C++ language generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants