[PATCH] D45470: Emit an error when include after

2018-05-15 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment.

Thanks for review.


Repository:
  rL LLVM

https://reviews.llvm.org/D45470



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45470: Emit an error when include after

2018-05-15 Thread Volodymyr Sapsai via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL332413: Emit an error when include atomic after 
stdatomic.h (authored by vsapsai, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D45470?vs=145817=146946#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D45470

Files:
  libcxx/trunk/include/atomic


Index: libcxx/trunk/include/atomic
===
--- libcxx/trunk/include/atomic
+++ libcxx/trunk/include/atomic
@@ -555,6 +555,9 @@
 #if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
 #error  is not implemented
 #endif
+#ifdef kill_dependency
+#error C++ standard library is incompatible with 
+#endif
 
 #if _LIBCPP_STD_VER > 14
 # define __cpp_lib_atomic_is_always_lock_free 201603L


Index: libcxx/trunk/include/atomic
===
--- libcxx/trunk/include/atomic
+++ libcxx/trunk/include/atomic
@@ -555,6 +555,9 @@
 #if !defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_GCC_ATOMIC_IMP)
 #error  is not implemented
 #endif
+#ifdef kill_dependency
+#error C++ standard library is incompatible with 
+#endif
 
 #if _LIBCPP_STD_VER > 14
 # define __cpp_lib_atomic_is_always_lock_free 201603L
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45470: Emit an error when include after

2018-05-09 Thread Volodymyr Sapsai via Phabricator via cfe-commits
vsapsai added a comment.

In https://reviews.llvm.org/D45470#1092260, @jfb wrote:

> 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 `` before `` as well as with the order 
> reversed?




  #include 
  #include 

> fatal error: too many errors emitted, stopping now [-ferror-limit=]



  #include 
  #include 

> no errors

So when `` is //after// ``, I add one more error to 
existing. When `` is //before// ``, there are no errors 
and I don't add anything.


https://reviews.llvm.org/D45470



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45470: Emit an error when include after

2018-05-08 Thread JF Bastien via Phabricator via cfe-commits
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 `` before `` 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 

I checked and C guarantees that this is a macro :)


https://reviews.llvm.org/D45470



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits