-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Use proper check for non-type template parameters #2247
Conversation
I wonder if they can be reproduced on godbolt. |
I don't think it's possible, because they are runtime errors, but ASAIK godbolt couldn't run executables with the MSVC toolchain. The problem, as I see it, is that MSVC installed on CI cannot prepare the correct executable with C++20 enabled. Even I don't know what causes this error: maybe it's the specific MSVC version on CI, maybe even the latest MSVC version with C++20 enabled has this error... who knows. I'm 99.9% sure that the changed check works for Clang, GCC and MSVC, because I tested this check on Compiler Explorer separately, but I'm unable to test how does NTTP work on MSVC because of this error. |
I found the cause of this problem - it's the outdated/custom GMock/GTest library. SEH is invoked by lines like this But after updating GMock/GTest, I thought - why can't we just take GMock/GTest from the official repo, shrink it if needed, probably add a custom CMakeLists.txt, and we would have an easy-maintainable test library. IMHO, what we have right now is odd because it looks like besides some probably meaningful fixes that probably should also be fixed in the original repo: Line 11 in b441532
there are some really strange changes like: 7f723fb#diff-725d68160f11d33d5caa60bd3fd7bad7c19028b7f36aaae0bf1ff383c71d6cec or even 58b6f8d#diff-725d68160f11d33d5caa60bd3fd7bad7c19028b7f36aaae0bf1ff383c71d6cec. So, maybe we should use not only updated but reorganized (or should I say non-reorganized, by hand) GMock/GTest? |
Yeah, we should update gtest/gmock. |
But the question is how should we do this, by taking the untouched version from googletest repo or by updating the existing files? I like the first option and can create a separate PR for this change. But maybe there are some pitfalls with that approach. |
Taking the fused version of gtest and gmock. I tried to update them in 3f4a99b and it mostly works but requires some portability fixes for older platforms. |
Ohh... that's why files look so strange, I was not aware of that script. |
I've updated gtest/gmock which hopefully resolves the issue with core-test. |
40df64c
to
787bb84
Compare
With an updated GTest/GMock version, MSVC C++20 works fine 👍 Maybe it would be reasonable to exclude all GTest/GMock files from clang-format, so it won't be formatted accidentally. Of course, this is impossible without moving |
That's a good idea. We could move |
Can we reduce the number of build configs a bit? Let's remove Win32 C++20 configs since they don't add much value. |
787bb84
to
ff11fb3
Compare
After GTest update, I'm getting:
because Line 38 in 69bdc20
includes |
How about replacing |
Maybe it will be better to do something like this - alexezeder@7d5d037, since we are already changing GTest library. I was thinking about PR this change to the GTest repo, but looking at the amount of PRs there and their dates... it's probably almost impossible. Also, they specified that only GCC 5.0+ are supported, no one likes old compilers 😔 |
Sounds good. |
Thank you! |
More info here - #2240 (comment)
Also,
FMT_CONSTEXPR_CHAR_TRAITS
was fixed for MSVC and two C++20 MSVC configurations were added to CI: