summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/store
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 11:08:30 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 11:08:30 +0100
commit1cd6e2e08eba3bc55fbf6dda3cd3d19a5d95f798 (patch)
tree80523fffccbcfaccf65676b7d42773b6ca75997f /compilerplugins/clang/store
parentb9042d2e46f4a0645b63efb23e49b9421d04d837 (diff)
Keep LibreOfficeKit.hxx compatible with C++03
Change-Id: Ic2f123c9b341dbb421b766c3bba1fc56c1bfb41d
Diffstat (limited to 'compilerplugins/clang/store')
-rw-r--r--compilerplugins/clang/store/nullptr.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/compilerplugins/clang/store/nullptr.cxx b/compilerplugins/clang/store/nullptr.cxx
index 528bb6aac9bc..83812d0ccd49 100644
--- a/compilerplugins/clang/store/nullptr.cxx
+++ b/compilerplugins/clang/store/nullptr.cxx
@@ -42,6 +42,8 @@ public:
bool VisitImplicitCastExpr(CastExpr const * expr);
private:
+ bool isInLokIncludeFile(SourceLocation spellingLocation) const;
+
bool isFromCIncludeFile(SourceLocation spellingLocation) const;
bool isMacroBodyExpansion(SourceLocation location) const;
@@ -134,6 +136,8 @@ bool Nullptr::VisitImplicitCastExpr(CastExpr const * expr) {
((!compiler.getLangOpts().CPlusPlus
|| isInUnoIncludeFile(
compiler.getSourceManager().getSpellingLoc(loc))
+ || isInLokIncludeFile(
+ compiler.getSourceManager().getSpellingLoc(loc))
|| isFromCIncludeFile(
compiler.getSourceManager().getSpellingLoc(loc)))
? "NULL" : "nullptr"));
@@ -143,6 +147,11 @@ bool Nullptr::VisitImplicitCastExpr(CastExpr const * expr) {
return true;
}
+bool Nullptr::isInLokIncludeFile(SourceLocation spellingLocation) const {
+ return compiler.getSourceManager().getFilename(spellingLocation)
+ .startswith(SRCDIR "/include/LibreOfficeKit/");
+}
+
bool Nullptr::isFromCIncludeFile(SourceLocation spellingLocation) const {
return !compat::isInMainFile(compiler.getSourceManager(), spellingLocation)
&& (StringRef(