This change fixes part 1 described by Artem in the Bugzilla report 43364. The comparison done was on a canonical, but should have been done on an unqualified type. Without using the unqualified type, the type comparison in this specific case is for "const Type * const" against "Type * const", which for the purposes of static analysis can be done not considering the Type's const qualifier. This is best done using a nonqualified type comparison.
Test cases were added to cover this change.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Thanks!! This definitely doesn't sort out all the problems of this kind, but that's a strict improvement.
Do you have commit access? Or i could commit for you.
clang/test/Analysis/uninit-val-const-likeness.c | ||
---|---|---|
22 | I suggest adding // no-warning markers on the lines on which warnings were previously emitted. It doesn't have any physical meaning, just makes it easier to understand what the test is about when you accidentally break it. |
Comment Actions
Great! I have one question though. Will this also work as intended with sugared types? (e.g. typedefs)
I believe this might be one of the main reason why the original author used canonical types in the first place.
I suggest adding // no-warning markers on the lines on which warnings were previously emitted. It doesn't have any physical meaning, just makes it easier to understand what the test is about when you accidentally break it.