[PATCH] D62156: [Sema][PR41730] Diagnose addr space mismatch while constructing objects

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 15:22:53 PDT 2019


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

Okay, LGTM.



================
Comment at: test/SemaCXX/address-space-ctor.cpp:11
+//expected-note at -6{{candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'MyType &&' for 1st argument}}
+//expected-note at -6{{candidate constructor ignored: cannot be used to construct an object in address space '__attribute__((address_space(10)))'}}
+//expected-note at -8{{candidate constructor ignored: cannot be used to construct an object in address space '__attribute__((address_space(10)))'}}
----------------
Anastasia wrote:
> Not sure if we should change to:
>   cannot be used to construct an object with '__attribute__((address_space(10)))'
> 
> Although for OpenCL it would be ok as is.
> 
> Or may be it's better to add custom printing of addr spaces?
Some sort of custom printing of address spaces would probably be best, yeah.  Users probably think of them as whatever custom syntax/macro they normally write, not as an application of some weird attribute.  We do a similar sort of thing with vector types where we generally just print them as `float4` or whatever without an `aka` clause because we don't expect anyone to know about those attributes.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62156/new/

https://reviews.llvm.org/D62156





More information about the cfe-commits mailing list