Skip to content

Unexpected bounds error after PR #903 #969

Closed
@john-h-kastner

Description

@john-h-kastner

This example fails bounds checking after PR #903 with the error message error: it is not possible to prove argument meets declared bounds for 2nd parameter.

void foo(_Array_ptr<char> dest : count(n), _Array_ptr<char> src : count(n), int n);

struct bar {
  _Array_ptr<char> x : count(l);
  int l;
};

void test(_Array_ptr<char> a : count(c), int c) {
  struct bar b = {a, c};
  foo(a, b.x, c);
}

Before the PR was merged, the compiler gave a warning instead. warning: cannot prove argument meets declared bounds for 2nd parameter. Is this change intentional? If so, what would be the correct way to write the above so that is accepted?

Metadata

Metadata

Assignees

Labels

bugThis labels issues that are bugs.priority:2This labels bugs that require immediate attention.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions