[clang] [Clang] Add #pragma clang deprecated_header (PR #168041)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 9 00:23:58 PST 2025
================
@@ -490,6 +490,18 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
SourceMgr.getFileEntryForID(CurPPLexer->getFileID())))
FoundPCHThroughHeader = true;
+ if (CurPPLexer) {
+ if (OptionalFileEntryRef File = CurPPLexer->getFileEntry()) {
+ if (auto MaybeMessage = HeaderInfo.getHeaderDeprecationMessage(*File);
+ MaybeMessage) {
+ std::string_view Message = *MaybeMessage;
+ Diag(SourceMgr.getIncludeLoc(CurPPLexer->getFileID()),
+ diag::warn_pragma_deprecated_header)
+ << !Message.empty() << Message;
----------------
cor3ntin wrote:
Can we avoid duplicating this code?
https://github.com/llvm/llvm-project/pull/168041
More information about the cfe-commits
mailing list