[PATCH] D45470: Emit an error when mixing <stdatomic.h> and <atomic>

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 9 18:27:53 PDT 2018


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 problem is a missing macro but after defining it you can discover that the situations is more complex. Also in some cases omitting a header content can lead to other errors which can be confusing too.


https://reviews.llvm.org/D45470





More information about the cfe-commits mailing list