[PATCH] D67023: Diagnose use of ATOMIC_VAR_INIT

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 15:47:39 PDT 2019


aaron.ballman marked an inline comment as done.
aaron.ballman added inline comments.


================
Comment at: lib/Lex/PPMacroExpansion.cpp:523
+      llvm::sys::path::filename(getSourceManager().getFilename(
+          M.getLocalDirective()->getLocation())) == "stdatomic.h") {
+    Diag(Identifier, diag::warn_pp_macro_deprecated)
----------------
rsmith wrote:
> This assumes there is a local directive for the macro. There need not be (it could be imported from a module). We should presumably check to see if all active macro directives are from that header instead.
I'm not familiar with how that's done -- is there some existing code doing something similar I should model off of? Also, what would the test case look like for that scenario?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67023/new/

https://reviews.llvm.org/D67023





More information about the cfe-commits mailing list