Open llvmbot opened 8 years ago
Looks broken:
test.cpp:10:14: error: cannot initialize a variable of type 'AS1 int *' with an rvalue of type 'int *'
10 | int AS1* x = &(f->*(&foo::bar));
| ^ ~~~~~~~~~~~~~~~~~~
@llvm/issue-subscribers-clang-frontend
Compiler explorer link for the previous comment: https://godbolt.org/z/4v3fzv4rj
code:
struct foo {
int bar;
};
#define AS1 __attribute__((address_space(1)))
int main()
{
foo AS1* f;
int AS1* x = &(f->*(&foo::bar));
}
Extended Description
The lvalue resulting from pointer-to-member operators . and -> is always in address space 0, without regards to the address space of the left-hand value; see attached test.cpp file for a test case.