[PATCH] D78366: [Preamble] Allow recursive inclusion of header-guarded mainfile.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 07:32:15 PDT 2020


sammccall created this revision.
sammccall added a reviewer: kadircet.
Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, ilya-biryukov.
Herald added a project: clang.

This is guaranteed to be a no-op without the preamble, so should be a
no-op with it too.

Partially fixes https://github.com/clangd/clangd/issues/337
This doesn't yet work for #ifndef guards, which are not recognized in preambles.
see D78038 <https://reviews.llvm.org/D78038>

I can't for the life of me work out how to test this outside clangd.
The original reentrant preamble diagnostic was untested, I added a test
to clangd for that too.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78366

Files:
  clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
  clang/lib/Lex/PPDirectives.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78366.258315.patch
Type: text/x-patch
Size: 4117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200417/3ee3ffaf/attachment.bin>


More information about the cfe-commits mailing list