[all-commits] [llvm/llvm-project] ee12ed: [Preamble] Allow recursive inclusion of header-gua...

Sam McCall via All-commits all-commits at lists.llvm.org
Mon Apr 20 08:29:22 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ee12edcb76423c78b55cdddae2edfe45cbb2ccd6
      https://github.com/llvm/llvm-project/commit/ee12edcb76423c78b55cdddae2edfe45cbb2ccd6
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-04-20 (Mon, 20 Apr 2020)

  Changed paths:
    M clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
    M clang/lib/Lex/PPDirectives.cpp

  Log Message:
  -----------
  [Preamble] Allow recursive inclusion of header-guarded mainfile.

Summary:
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

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.

Reviewers: kadircet

Subscribers: ilya-biryukov, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78366




More information about the All-commits mailing list