summaryrefslogtreecommitdiffstats
path: root/compilerplugins/clang/includeform.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-03-23 21:15:26 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-03-23 21:15:26 +0100
commit23f439df05188785f7701763b3c24d8dff3df415 (patch)
tree48b84d3666717fd19f08b37222b074aafad7b299 /compilerplugins/clang/includeform.cxx
parentUpdated core (diff)
downloadcore-23f439df05188785f7701763b3c24d8dff3df415.tar.gz
core-23f439df05188785f7701763b3c24d8dff3df415.zip
...in which case .. path segments need to be resolved in SearchPath, too
...for cases like > In file included from vcl/source/outdev/hatch.cxx:32: > vcl/source/outdev/../gdi/pdfwriter_impl.hxx:47:10: error: replace "..." include form with <...> for inclusion of a source file not next to the current source file, or a header, vcl/source/outdev/../gdi/pdffontcache.hxx [loplugin:includeform] > #include "pdffontcache.hxx" > ^~~~~~~~~~~~~~~~~~ Change-Id: Ib486e0cf16a157b90f838536a15c40c2a34ef72b
Diffstat (limited to 'compilerplugins/clang/includeform.cxx')
-rw-r--r--compilerplugins/clang/includeform.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/compilerplugins/clang/includeform.cxx b/compilerplugins/clang/includeform.cxx
index becc1c028c3c..284b7dadccff 100644
--- a/compilerplugins/clang/includeform.cxx
+++ b/compilerplugins/clang/includeform.cxx
@@ -52,6 +52,8 @@ private:
|| loplugin::hasPathnamePrefix(
SearchPath, WORKDIR "/UnpackedTarball"));
} else {
+ auto dir1 = std::string(SearchPath);
+ loplugin::normalizeDotDotInFilePath(dir1);
auto const file = StringRef(
compiler.getSourceManager().getPresumedLoc(HashLoc)
.getFilename());
@@ -64,9 +66,9 @@ private:
pos = pos2;
}
#endif
- auto dir = std::string(compat::take_front(file, pos));
- loplugin::normalizeDotDotInFilePath(dir);
- shouldUseAngles = !loplugin::isSamePathname(SearchPath, dir);
+ auto dir2 = std::string(compat::take_front(file, pos));
+ loplugin::normalizeDotDotInFilePath(dir2);
+ shouldUseAngles = !loplugin::isSamePathname(dir1, dir2);
}
if (shouldUseAngles == IsAngled) {
return;