[cfe-dev] Pointer-to-member does not honor LHS address space

mats petersson via cfe-dev cfe-dev at lists.llvm.org
Thu Jan 12 09:32:31 PST 2017


Put it up for review in Phabricator, with a reference to the bug.
For more on phabricator: http://llvm.org/docs/Phabricator.html

You'll probably be asked to add a test-case so that if someone
removes/alters that line, some test(s) will fail. (Using your sampel would
probably be fine, just wrapping the usual test-stuff around it - find some
similar type of tests somewhere and do suitable copy/paste/modify editing).

Wait for feedback on the review, update as appropriate, repeat until
approved.

Once the review is approved, ask someone to commit it (I presume you don't
have permission to commit).

--
Mats

--
Mats

On 12 January 2017 at 07:46, Félix Cloutier via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello all,
>
> About a year ago, I found a bug with the interaction of address spaces and
> C++ pointers to members. Applying a pointer-to-member to a pointer discards
> the address space of the pointer if it had one. For instance, with this
> code:
>
> struct foo {
>     int bar;
> };
>
> #define AS1 __attribute__((address_space(1)))
>
> int main()
> {
>     foo AS1* f;
>     int AS1* x = &(f->*(&foo::bar));
> }
>
>
> Clang says:
>
> cannot initialize a variable of type '__attribute__((address_space(1)))
> int *' with an rvalue of type 'int *'
>
>
> I filed a bug (https://llvm.org/bugs/show_bug.cgi?id=25941) and even had
> a patch for it when I found it, but I never followed through. The patch is
> one single line of code and appears to be still applicable. What are the
> next steps to get the problem fixed?
>
> Félix
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170112/3f606f40/attachment.html>


More information about the cfe-dev mailing list