Skip to content
Commit 7add5820 authored by Leonard Chan's avatar Leonard Chan
Browse files

[Sema] Fix for crash on conditional operation with address_space pointer

Compiling the following causes clang to crash

```
char *cmp(__attribute__((address_space(1))) char *x, __attribute__((address_space(2))) char *y) {
  return x < y ? x : y;
}
```

with the message: "wrong cast for pointers in different address
spaces(must be an address space cast)!"

This is because during IR emission, the source and dest type for a
bitcast should not have differing address spaces.

This fix prints an error since the code shouldn't compile in the first place.

Differential Revision: https://reviews.llvm.org/D50278

llvm-svn: 339167
parent 0edcd027
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment