Closed
Description
Consider the following example:
void f(_Nt_array_ptr<int> p : count(i), unsigned int i) {
if (*(p + i)) {
++i;
}
}
At the beginning of the statement ++i
, p
has the widened bounds bounds(p, p + i + 1)
. The original value of i
is i - 1
. At the end of the statement ++i
, p
has the inferred bounds bounds(p, p + i - 1 + 1)
. The compiler currently emits a warning: "cannot prove inferred bounds for p imply declared bounds for p after increment". These bounds are in fact equivalent to bounds(p, p + i)
if we perform constant folding, so the compiler should not emit a warning here.
Metadata
Metadata
Assignees
Labels
No labels