diff options
-rw-r--r-- | compilerplugins/clang/plugin.cxx | 26 | ||||
-rw-r--r-- | desktop/source/app/opencl.cxx | 3 | ||||
-rw-r--r-- | forms/source/solar/control/navtoolbar.cxx | 3 |
3 files changed, 23 insertions, 9 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx index 6839fec0a836..01484bddc432 100644 --- a/compilerplugins/clang/plugin.cxx +++ b/compilerplugins/clang/plugin.cxx @@ -285,6 +285,8 @@ bool Plugin::isUnitTestMode() bool Plugin::containsPreprocessingConditionalInclusion(SourceRange range) { + // Preprocessing directives (other than _Pragma, which is not relevant here) cannot appear in + // macro expansions, so it is safe to just consider the range of expansion locations: auto const begin = compiler.getSourceManager().getExpansionLoc( range.getBegin()); auto const end = compiler.getSourceManager().getExpansionLoc( @@ -294,8 +296,15 @@ bool Plugin::containsPreprocessingConditionalInclusion(SourceRange range) || compiler.getSourceManager().isBeforeInTranslationUnit( begin, end))) { - // Conservatively assume "yes" if lexing fails (e.g., due to - // macros): + if (isDebugMode()) { + report( + DiagnosticsEngine::Fatal, + ("unexpected broken range for Plugin::containsPreprocessingConditionalInclusion," + " case 1"), + range.getBegin()) + << range; + } + // Conservatively assume "yes" if lexing fails: return true; } auto hash = false; @@ -305,8 +314,15 @@ bool Plugin::containsPreprocessingConditionalInclusion(SourceRange range) loc, tok, compiler.getSourceManager(), compiler.getLangOpts(), true)) { - // Conservatively assume "yes" if lexing fails (e.g., due to - // macros): + if (isDebugMode()) { + report( + DiagnosticsEngine::Fatal, + ("unexpected broken range for" + " Plugin::containsPreprocessingConditionalInclusion, case 2"), + loc) + << range; + } + // Conservatively assume "yes" if lexing fails: return true; } if (hash && tok.is(tok::raw_identifier)) { @@ -317,7 +333,7 @@ bool Plugin::containsPreprocessingConditionalInclusion(SourceRange range) return true; } } - if (loc == range.getEnd()) { + if (loc == end) { break; } hash = tok.is(tok::hash) && tok.isAtStartOfLine(); diff --git a/desktop/source/app/opencl.cxx b/desktop/source/app/opencl.cxx index 6edb7c077180..5ef73dd70cf9 100644 --- a/desktop/source/app/opencl.cxx +++ b/desktop/source/app/opencl.cxx @@ -209,8 +209,7 @@ void Desktop::CheckOpenCLCompute(const Reference< XDesktop2 > &xDesktop) } // Append our app version as well. - aSelectedCLDeviceVersionID += "--"; - aSelectedCLDeviceVersionID += LIBO_VERSION_DOTTED; + aSelectedCLDeviceVersionID += "--" LIBO_VERSION_DOTTED; // Append timestamp of the file. OUString aURL("$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/opencl/cl-test.ods"); diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index 2e8f82aff31d..a512c54a0793 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -57,8 +57,7 @@ namespace frm OUString getLabelString(const char* pResId) { - OUString sLabel( " " ); - sLabel += FRM_RES_STRING(pResId); + OUString sLabel( " " + FRM_RES_STRING(pResId) ); sLabel += " "; return sLabel; } |