From eb00ee07beff4fab367fa16b8074ba9856469f52 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 22 May 2017 21:42:58 +0000 Subject: Give files from #line the characteristics of the current file This allows #line directives to appear in system headers that have code that clang would normally warn on. This is compatible with GCC, which is easy to test by running `gcc -E`. Fixes PR30752 llvm-svn: 303582 --- clang/lib/Lex/Pragma.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Lex/Pragma.cpp') diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 99d56182c1b..2d078a4e760 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/lib/Lex/Pragma.cpp @@ -475,9 +475,9 @@ void Preprocessor::HandlePragmaSystemHeader(Token &SysHeaderTok) { // Emit a line marker. This will change any source locations from this point // forward to realize they are in a system header. // Create a line note with this information. - SourceMgr.AddLineNote(SysHeaderTok.getLocation(), PLoc.getLine()+1, + SourceMgr.AddLineNote(SysHeaderTok.getLocation(), PLoc.getLine() + 1, FilenameID, /*IsEntry=*/false, /*IsExit=*/false, - /*IsSystem=*/true, /*IsExternC=*/false); + SrcMgr::C_System); } /// HandlePragmaDependency - Handle \#pragma GCC dependency "foo" blah. -- cgit v1.2.3