diff options
| author | Volodymyr Sapsai <vsapsai@apple.com> | 2018-04-13 17:43:15 +0000 |
|---|---|---|
| committer | Volodymyr Sapsai <vsapsai@apple.com> | 2018-04-13 17:43:15 +0000 |
| commit | 1f70bddb838837afff2fa74475e7bff101691557 (patch) | |
| tree | 981b01c22a415922d0a563478e5830cf987d6a0e /clang/test/Frontend/Inputs | |
| parent | ddf3db9b5eddc6c7cc75fd30eea545c22ad70dcd (diff) | |
| download | bcm5719-llvm-1f70bddb838837afff2fa74475e7bff101691557.tar.gz bcm5719-llvm-1f70bddb838837afff2fa74475e7bff101691557.zip | |
Fix evaluation of `__has_include_next` during -frewrite-includes.
`__has_include_next` requires correct DirectoryLookup for being
evaluated correctly. We were using Preprocessor::GetCurDirLookup() but
we were calling it after the preprocessor finished its work. And in this
case CurDirLookup is always nullptr which makes `__has_include_next`
behave as `__has_include`.
Fix by storing and using CurDirLookup when preprocessor enters a file,
not when we rewrite the includes.
rdar://problem/36305026
Reviewers: bkramer
Reviewed By: bkramer
Subscribers: jkorous-apple, cfe-commits
Differential Revision: https://reviews.llvm.org/D45603
llvm-svn: 330041
Diffstat (limited to 'clang/test/Frontend/Inputs')
| -rw-r--r-- | clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h | 1 | ||||
| -rw-r--r-- | clang/test/Frontend/Inputs/rewrite-includes9.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h b/clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h new file mode 100644 index 00000000000..b074bd1a446 --- /dev/null +++ b/clang/test/Frontend/Inputs/NextIncludes/rewrite-includes9.h @@ -0,0 +1 @@ +included_line9 diff --git a/clang/test/Frontend/Inputs/rewrite-includes9.h b/clang/test/Frontend/Inputs/rewrite-includes9.h new file mode 100644 index 00000000000..ebd5ada9705 --- /dev/null +++ b/clang/test/Frontend/Inputs/rewrite-includes9.h @@ -0,0 +1,3 @@ +#if __has_include_next(<rewrite-includes9.h>) +#include_next <rewrite-includes9.h> +#endif |

