Hendrik =?utf-8?q?Hübner?= <[email protected]>,
Hendrik =?utf-8?q?Hübner?= <[email protected]>,
Hendrik =?utf-8?q?Hübner?= <[email protected]>,
Hendrik =?utf-8?q?Hübner?= <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -12353,20 +12353,20 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType
LHS, QualType RHS) {
// If the qualifiers are different, the types can still be merged.
Qualifiers LQuals = LHSCan.getLocalQualifiers();
Qualifiers RQuals = RHSCan.getLocalQualifiers();
- if (LQuals != RQuals) {
- // If any of these qualifiers are different, we have a type mismatch.
- if (LQuals.getCVRQualifiers() != RQuals.getCVRQualifiers() ||
- LQuals.getAddressSpace() != RQuals.getAddressSpace())
- return {};
+ if (LQuals.withoutObjCGCAttr() != RQuals.withoutObjCGCAttr()) {
+ // Reject immediately, if anything but the GC qualifiers is different.
+ return {};
+ }
+
+ if (LQuals != RQuals) {
// Exactly one GC qualifier difference is allowed: __strong is
// okay if the other type has no GC qualifier but is an Objective
// C object pointer (i.e. implicitly strong by default). We fix
// this by pretending that the unqualified type was actually
// qualified __strong.
Qualifiers::GC GC_L = LQuals.getObjCGCAttr();
Qualifiers::GC GC_R = RQuals.getObjCGCAttr();
- assert((GC_L != GC_R) && "unequal qualifier sets had only equal elements");
----------------
ahatanak wrote:
I think we want to keep this assert, unless there's a reason to remove it.
https://github.com/llvm/llvm-project/pull/203272
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits