[PATCH] D75171: [Analyzer] Fix for incorrect use of container and iterator checkers

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 10 05:12:14 PDT 2020


Szelethus added a comment.

Yay, this is very nice!



================
Comment at: clang/test/Analysis/container-modeling-no-aggressive-binary-operation-simplification-warn.cpp:1-10
+// RUN: %clang_analyze_cc1 -std=c++11\
+// RUN: -analyzer-checker=core,cplusplus,alpha.cplusplus.ContainerModeling\
+// RUN: -analyzer-config c++-container-inlining=false %s 2>&1 | FileCheck %s
+
+// RUN: %clang_analyze_cc1 -std=c++11\
+// RUN: -analyzer-checker=core,cplusplus,alpha.cplusplus.ContainerModeling\
+// RUN: -analyzer-config c++-container-inlining=true -DINLINE=1 %s 2>&1 |\
----------------
What does this file do that `clang/test/Analysis/iterator-modeling-no-aggressive-binary-operation-simplification-no-crash.cpp` doesn't?


================
Comment at: clang/test/Analysis/iterator-modeling-no-aggressive-binary-operation-simplification-no-crash.cpp:38-39
+  if (V.end() != first) {
+    clang_analyzer_eval(clang_analyzer_container_end(V) ==
+                        clang_analyzer_iterator_position(first));
+  }
----------------
Is this where the crash supposed to happen? Can you mark it with `// no-crash`?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75171/new/

https://reviews.llvm.org/D75171





More information about the cfe-commits mailing list