Re: [PATCH] D13099: [Analyzer] Don’t invalidate CXXThis when conservatively evaluating const methods (PR 21606)

Anna Zaks via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 14:07:10 PDT 2015


zaks.anna added a comment.

> Again I'm not sure this is worth checking for, based on the assumption that a reasonable const method won't modify the relevant object. What do people think?


These are heuristics. I think dealing with this case should not be a pre-requisite for the patch. We can see how much this is an issue in practice through evaluation on existing codebases as well as getting user feedback once this lands.


================
Comment at: test/Analysis/PR21606.cpp:2
@@ +1,3 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core
+// PR21606
+
----------------
Can this be moved into some other test file?
You can have the PR name in a comment or a method name.

================
Comment at: test/Analysis/const-method-call.cpp:72
@@ +71,3 @@
+
+void checkThatConstMethodDoesInvalidateInheritedPointedAtMemory() {
+  int x = 1;
----------------
Maybe we should add a test case where the const method is inherited?


http://reviews.llvm.org/D13099





More information about the cfe-commits mailing list