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

cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression #15

Closed
0vercl0k opened this issue Jan 16, 2021 · 0 comments · Fixed by #16
Labels
bug Something isn't working

Comments

@0vercl0k
Copy link
Owner

I've come across this error on clang-11:

../libs/kdmp-parser/src/lib/kdmp-parser-structs.h:39:20: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr uint64_t OffsetFromThis(const void *This, const void *Field) {
                   ^
../libs/kdmp-parser/src/lib/kdmp-parser-structs.h:40:10: note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression
  return uint64_t(Field) - uint64_t(This);
         ^
1 error generated.
@0vercl0k 0vercl0k added the bug Something isn't working label Jan 16, 2021
0vercl0k added a commit that referenced this issue Jan 16, 2021
This PR fixes #15 as well as adding clang-11 to the CI to avoid similar issues in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant