vsapsai updated this revision to Diff 145817.
vsapsai added a comment.
Here is another approach that should emit an error only when mixing headers
causes compilation problems.
Have no ideas how to test the change. `-verify` doesn't work with fatal errors
and libcxx doesn't use FileCheck. Performe
vsapsai reopened this revision.
vsapsai added a comment.
This revision is now accepted and ready to land.
`__ALLOW_STDC_ATOMICS_IN_CXX__` approach didn't work in practice, I've reverted
all changes.
Repository:
rC Clang
https://reviews.llvm.org/D45470
_
vsapsai added a comment.
In https://reviews.llvm.org/D45470#1087026, @jfb wrote:
> This isn't bad, so I'd go with it, but separately I imagine that we could
> implement the suggestion in http://wg21.link/p0943 and expose it even before
> C++20? Not sure we do this much, but I'd argue that befor
jfb added a comment.
This isn't bad, so I'd go with it, but separately I imagine that we could
implement the suggestion in http://wg21.link/p0943 and expose it even before
C++20? Not sure we do this much, but I'd argue that before that fix stdatomic.h
is just useless anyways, so it's a fine bre
vsapsai added a comment.
Thanks for the review, Marshall.
In the end I removed `XFAIL: with_system_cxx_lib` from libc++ test as the
change is header-only at compile time. Library behaviour at runtime shouldn't
be affected.
Repository:
rC Clang
https://reviews.llvm.org/D45470
___
This revision was automatically updated to reflect the committed changes.
Closed by commit rC331378: Emit an error when mixing and
(authored by vsapsai, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D45470?vs=143817&id=144903#toc
Repository:
rC Clan
vsapsai updated this revision to Diff 143817.
vsapsai added a comment.
- Tighten up a test with expected-error per review comment.
https://reviews.llvm.org/D45470
Files:
clang/lib/Headers/stdatomic.h
clang/test/Headers/stdatomic.cpp
libcxx/include/atomic
libcxx/test/libcxx/atomics/c_com
vsapsai planned changes to this revision.
vsapsai added inline comments.
Comment at: clang/test/Headers/stdatomic.cpp:4
+
+#include
+
mclow.lists wrote:
> Is there a reason we want to test this twice - once in clang and once in
> libc++?
> We can use `expected-
mclow.lists added inline comments.
Comment at: clang/test/Headers/stdatomic.cpp:4
+
+#include
+
Is there a reason we want to test this twice - once in clang and once in libc++?
We can use `expected-error` in libc++ tests to check the error.
https://reviews.ll
vsapsai added a comment.
Herald added a subscriber: jkorous.
Ping.
https://reviews.llvm.org/D45470
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
vsapsai added a comment.
In addition to the currently proposed approach
#if ...
#error ...
#endif
// header content
I also tried
#if ...
#error ...
#else
// header content
#endif
It allows to have fewer error messages but can be more surprising. It can look
like the only pro
vsapsai created this revision.
vsapsai added reviewers: rsmith, EricWF, mclow.lists.
Herald added subscribers: christof, jkorous-apple.
Atomics in C and C++ are incompatible at the moment and mixing the
headers can result in confusing error messages.
Emit an error explicitly telling about the inc
12 matches
Mail list logo