[PATCH] D45470: Emit an error when include <atomic> after <stdatomic.h>
JF Bastien via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 8 17:25:09 PDT 2018
jfb added a comment.
In https://reviews.llvm.org/D45470#1092212, @vsapsai wrote:
> 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. Performed only manual testing.
This worked with `<atomic>` before `<stdatomic.h>` as well as with the order reversed?
LGTM pending testing answer. This seems simpler than implementing http://wg21.link/p0943 outright, though that would still be the best solution IMO.
================
Comment at: libcxx/include/atomic:558
#endif
+#ifdef kill_dependency
+#error C++ standard library is incompatible with <stdatomic.h>
----------------
I checked and C guarantees that this is a macro :)
https://reviews.llvm.org/D45470
More information about the cfe-commits
mailing list