Skip to content

Assume bounds cast fails for function pointers #855

Closed
@Machiry

Description

@Machiry

File:

#include <stdlib.h>
int foo(void) {
  _Ptr<void (void *)> p = _Assume_bounds_cast<_Ptr<void (void *)>>(NULL);
  return 0;
}

Trying to compile results in error:
clang -c foo.c --

3:27: error: can only cast function names or null pointers to checked function pointer type '_Ptr<void (void *)>'
  _Ptr<void (void *)> p = _Assume_bounds_cast<_Ptr<void (void *)>>(NULL);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions