You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Consider the following example:
At the beginning of the statement
++i
,p
has the widened boundsbounds(p, p + i + 1)
. The original value ofi
isi - 1
. At the end of the statement++i
,p
has the inferred boundsbounds(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 tobounds(p, p + i)
if we perform constant folding, so the compiler should not emit a warning here.The text was updated successfully, but these errors were encountered: