-
Details
Diff Detail
Event Timeline
Whoa, the test cases look AMAZING! I admit that I haven't read much of the other code just yet, but I like the results in any case.
clang/test/Analysis/cast-value-notes.cpp | ||
---|---|---|
4–5 | Hmm, we may want to move these eventually to clang/test/Inputs/, since this isn't the only LLVM checker. Thought that said, I want to see the other LLVM checker gone, like, purged from the codebase for being the abomination that it is. Feel free to leave these here for know, just thinking aloud :) |
clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp | ||
---|---|---|
214 | A body of a function is always either a CompoundStmt or (shockingly) a CXXTryStmt. This cast will always fail. | |
219 | I suspect that DRE may still be null (eg., when calling isa through function pointer). I think you should just lookup Call.getDecl()'s template arguments instead. It's going to be the declaration of the specific instantiation, so it'll have all the arguments. | |
247 | Can you use the overload without the bug report parameter? Cause you don't seem to be using it anyway. | |
clang/test/Analysis/cast-value-notes.cpp | ||
4–5 | I agree, extracting common definitions into a system header simulator usually ends up being worth it pretty quickly. | |
53 | I suggest: 'C' is a 'Circle', not a 'Triangle'. | |
59 | Just 'C' is a 'Circle'. | |
76 | This test looks incorrect. We shouldn't be assuming this, we already know that it's not a triangle because we know that it's a circle. |
Thanks for the reviews so far! I had a contradiction in my mind about regions, but now everything is okay and the notes are not misleading.
clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp | ||
---|---|---|
214 | I do not remember what I did here, but that was a working solution. | |
219 | That was the plan, just I did not realized I am a FunctionDecl away to achieve that. Thanks! |
LGTM with one minor nit!
clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp | ||
---|---|---|
234–236 | Mmm, this will need to be de-duplicated out. |
A body of a function is always either a CompoundStmt or (shockingly) a CXXTryStmt. This cast will always fail.