ormris marked 3 inline comments as done. ormris added a comment. Thanks for the comments so far.
================ Comment at: test/Analysis/loop-widening-invalid-type.cpp:1 +// RUN: %clang_cc1 -analyze -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-max-loop 4 -analyzer-config widen-loops=true -verify %s + ---------------- MTC wrote: > I think it's better to add more expressive tests. Like: > > ``` > struct A { > int x; > A(int x) : x(x) {} > }; > > void invalid_type_region_access() { > const A &a = A(10); > for(int i = 0; i < 10; ++i) {} > clang_analyzer_eval(a.x ==10); // expected-warning{{TRUE}} > } > ``` > > I think should use more related names instead of > `loop-widening-invalid-type.cpp`, like `loop-widening-reference-type`. Agreed. Fixed. ================ Comment at: test/Analysis/loop-widening-invalid-type.cpp:8 + +void invalid_type_region_access() { // expected-no-diagnostics + const A &x = B(); ---------------- MTC wrote: > I don't know what the purpose of the test is, is the comment `no-crash` > better? I've changed the test to (hopefully) look for a valid address for "x". Repository: rC Clang https://reviews.llvm.org/D47044 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits