[PATCH] D62156: [Sema][PR41730] Diagnose addr space mismatch while constructing objects
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 3 04:37:09 PDT 2019
Anastasia marked 2 inline comments as done.
Anastasia added inline comments.
================
Comment at: lib/Sema/SemaOverload.cpp:6095
+ // Check that addr space of an object being constructed is convertible to
+ // the one ctor qualified with.
+ if (!Qualifiers::isAddressSpaceSupersetOf(
----------------
rjmccall wrote:
> Anastasia wrote:
> > rjmccall wrote:
> > > "Check that the constructor is capable of constructing an object in the destination address space."
> > >
> > > Should there be an exception here for trivial default/copy/move constructors?
> > Good point. Current implementation is generating one overload of each default/copy/move in generic address space only. But we could potentially look at changing this. If we could add extra overloads once we encounter each new ctor invocation it would be the easiest approach and this code would still be applicable. However, I would need to understand the feasibility in more details. May be this is something for the future work? Or do you have other suggestions?
> It's fine to leave it as future work. I think synthesizing new overloads after the fact will probably be problematic for the AST, though, and it'll be easier to just treat trivial copy/move constructors (and assignment operators, for that matter) as implicitly being able to construct objects in all possible address spaces (as well as *from* all possible address spaces).
Ok, thanks! I will look into this later as a separate patch then.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62156/new/
https://reviews.llvm.org/D62156
More information about the cfe-commits
mailing list