-
Notifications
You must be signed in to change notification settings - Fork 270
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
[BUG] Error when including stdatomic.h inside extern "C" (r21 regression) #1177
Comments
Will be reverting the patch that caused the break in r21b. Similar warning as in #1178 (comment) though, I think this will be broken when the committee adopts the proposal discussed in that bug. The only way to avoid this bug (I think) is to avoid the In general, it's best to avoid having any |
Maybe we could |
Can you nest those? That would probably work. |
I did get an authoritative answer on this from multiple members of the C++ standard committee, and using http://eel.is/c++draft/using.headers#3
An Given that, I don't think we should be fixing this. I was in favor when we thought this behavior was unspecified, but given the prohibition in the spec I don't think there's any clear benefit to reverting to the old behavior in r21b if we're just going to let it break in r22 anyway. @enh-google, wdyt? |
yeah, makes sense to me --- this seems like the direction the world is going wrt |
Description
Including "stdatomic.h" inside an
extern "C"
block in a C++ file causes the following compile error with NDK r21, while building the same code with r20 works fine:test.cpp:
Compiled using:
Using NDK 20.1.5948944 in the above compile command works without issues.
I think the issue was introduced with change 1086558 in bionic:
As far as I can see,
_USING_LIBCXX
was previously undefined in NDK r20, causing stdatomic.h to use its C implementation instead of including C++ . Note thatdefined(__cplusplus)
will still be true inside theextern "C"
block.Environment Details
The text was updated successfully, but these errors were encountered: