[PATCH] D61318: [Sema] Prevent binding references with mismatching address spaces to temporaries

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 10:22:07 PDT 2019


rjmccall added inline comments.


================
Comment at: lib/Sema/SemaInit.cpp:4836
+  if (T1Quals.hasAddressSpace()) {
+    if (!T1Quals.isAddressSpaceSupersetOf(cv1T1IgnoreAS.getQualifiers())) {
+      Sequence.SetFailed(
----------------
Anastasia wrote:
> rjmccall wrote:
> > Isn't `cv1T1IgnoreAS.getQualifiers()` always `LangAS::Default`?
> Yes, this is true currently. However, we don't have an overload of `isAddressSpaceSupersetOf` that takes `LangAS` as a parameter. Are you suggesting to add it?
I think it would be sensible if there was a function that could answer the superset question with just two `LangAS` values, yeah.  Even with the current API, it would at least be clearer if you just manufactured a `Qualifiers` with no address space, since there's no dependency on any of the other qualifiers from `cv1T1IgnoreAS`.


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

https://reviews.llvm.org/D61318





More information about the cfe-commits mailing list