-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
If __GNUC__
, check if exceptions are enabled before using them
#60
Conversation
3172d47
to
ca7816b
Compare
Hi @chriselrod, thanks for the contribution! I had similar functionality in my older map, where I was doing it that way: and a generic I think it should be done in a similar way. I don't think please clang-format everything :) |
I've copied the check, I'll copy the Only when defining
Just found a bug in my editor configuration where things going through "c or c++ mode" weren't enabling the language server or getting formatted... |
My concern with the assert is that when compiling with |
Okay, I've copied the I also added likely/unlikely to each of these to indicate they're unlikely. |
I think the macos doctest problem can be fixed by upgrading doctest, please run |
35b1d1d
to
d570087
Compare
I'm getting this locally
However, after clearing my local CXXFLAGS and rerunning |
All checks passed, good to merge @martinus? |
Merged it, thank you! |
GCC and Clang both define
__EXCEPTIONS
when exceptions are enabled, and do not define it otherwise. They should also both define__GNUC__
.https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
Thus, this PR allows
unordered_dense
to compile with clang and gcc when using-fno-exceptions
, which isn't currently supported.It shouldn't change the behavior otherwise.
Not sure what the best way to test this is. Add
-fno-excpetions
to an arbitrary test that doesn't currently use exceptions and is compiled with clang or gcc?