[PATCH] D62156: [Sema] Diagnose addr space mismatch while constructing objects
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 20 13:00:15 PDT 2019
rjmccall added inline comments.
================
Comment at: lib/Sema/SemaDeclCXX.cpp:8229
+ if (FTI.hasMethodTypeCVRUQualifiers()) {
+ FTI.MethodQualifiers->forEachCVRUQualifier(
[&](DeclSpec::TQ TypeQual, StringRef QualName, SourceLocation SL) {
----------------
We want to catch `_Atomic`, too, so please just change this loop to ignore address-space qualifiers, using a flag to decide whether to call `setInvalidType`.
================
Comment at: lib/Sema/SemaInit.cpp:3773
+ if (Info.Constructor->getMethodQualifiers().isAddressSpaceSupersetOf(
+ DestType.getQualifiers())) {
+ // C++ [over.match.copy]p1:
----------------
Please add these constructors as candidates and then teach `AddOverloadCandidate` to reject them. If you need to set the destination address space on the `OverloadCandidateSet`, I think that would be reasonable.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62156/new/
https://reviews.llvm.org/D62156
More information about the cfe-commits
mailing list