[PATCH] D18641: [PP] Handle #include_next after include found relative to current one same as GCC

Dmitry Polukhin via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 05:06:15 PDT 2016


DmitryPolukhin created this revision.
DmitryPolukhin added a reviewer: rsmith.
DmitryPolukhin added a subscriber: cfe-commits.

GCC clears current search position in the include directories list used
for #include_next if current header was found using relative paths.
Before this patch Clang kept current position from previous header
included from directories list. Both approaches make sense but I thin it
is better to be GCC compatible in this question. See added test-case for
the example.

Also update warning text to give better understanding what happened.
Previous one about absolute path was incorrect and confusing.

http://reviews.llvm.org/D18641

Files:
  include/clang/Basic/DiagnosticLexKinds.td
  lib/Lex/HeaderSearch.cpp
  lib/Lex/PPDirectives.cpp
  lib/Lex/PPMacroExpansion.cpp
  test/Modules/Inputs/include_next/x/d.h
  test/Modules/Inputs/include_next/y/c.h
  test/Modules/Inputs/include_next/y/d.h
  test/Modules/include_next.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18641.52186.patch
Type: text/x-patch
Size: 4159 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160331/a5ea1f40/attachment.bin>


More information about the cfe-commits mailing list