[PATCH] D106394: [clang][pp] adds '#pragma include_instead'

Christopher Di Bella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 22 13:43:00 PDT 2021


cjdb marked 2 inline comments as done.
cjdb added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:307-310
+def pp_pragma_include_instead_unexpected_token : Warning<
+  "'#pragma include_instead' expects '%0' as its next token; got '%1' instead">,
+  InGroup<PragmaIncludeInstead>,
+  ShowInSystemHeader;
----------------
aaron.ballman wrote:
> No need for a new warning -- I think we can use existing diagnostics for this (like `err_pp_expects_filename`). Also, I think syntax issues should be diagnosed as an error instead of a warning -- we expect a particular syntactic form and it's reasonable for us to enforce that users get it right.
Hmm... the syntax is `#pragma clang include_instead(header)`. This is diagnosing the lack of `(` or `)`, not a missing filename. Perhaps there's already a diagnostic for that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106394



More information about the cfe-commits mailing list