summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-12-30 17:50:49 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-12-30 22:52:48 +0100
commitaab0322580c87864a4f0c0af1fed07282c8dccbb (patch)
tree7a1ac01391f623d27f88dc5dffd6b5006b7cc9bf /compilerplugins
parentb7cb509d38fc7183bc6f695f3f6390a10dfd70c7 (diff)
Disable loplugin:casttovoid when --disable-assert-always-abort
...as finding uses of variables in arguments to expand-to-nothing assert macros is just not implemented not implemented. Change-Id: Iacb3bd25d03eca13ac8ff3942f98e46dee3286b9 Reviewed-on: https://gerrit.libreoffice.org/47200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/casttovoid.cxx3
-rw-r--r--compilerplugins/clang/test/casttovoid.cxx1
2 files changed, 4 insertions, 0 deletions
diff --git a/compilerplugins/clang/casttovoid.cxx b/compilerplugins/clang/casttovoid.cxx
index e98388c8de7b..c67d7ca10870 100644
--- a/compilerplugins/clang/casttovoid.cxx
+++ b/compilerplugins/clang/casttovoid.cxx
@@ -336,6 +336,9 @@ private:
std::stack<QualType> returnTypes_;
void run() override {
+ if (compiler.getPreprocessor().getIdentifierInfo("NDEBUG")->hasMacroDefinition()) {
+ return;
+ }
if (!TraverseDecl(compiler.getASTContext().getTranslationUnitDecl())) {
return;
}
diff --git a/compilerplugins/clang/test/casttovoid.cxx b/compilerplugins/clang/test/casttovoid.cxx
index edd538690224..e82118259df9 100644
--- a/compilerplugins/clang/test/casttovoid.cxx
+++ b/compilerplugins/clang/test/casttovoid.cxx
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#undef NDEBUG
#include <cassert>
#define CAST_N3 (void) n3