summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorAnastasia Stulova <anastasia.stulova@arm.com>2019-01-18 11:38:16 +0000
committerAnastasia Stulova <anastasia.stulova@arm.com>2019-01-18 11:38:16 +0000
commitbda4ca2c1270911eedba8578334c21d45838c8fd (patch)
treeb23e4a55ed0d4058012a1d74e45dfb123521c3e8 /lib/Sema/SemaOverload.cpp
parent64179746caae8cbc5ce8c75c8abef697f2da2399 (diff)
downloadclang-bda4ca2c1270911eedba8578334c21d45838c8fd.tar.gz
[OpenCL] Fix overloading ranking rules for addrspace conversions.
Extend ranking to work with address spaces correctly when resolving overloads. Differential Revision: https://reviews.llvm.org/D56735 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 52be0598fb..276226b6da 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -4019,9 +4019,12 @@ CompareQualificationConversions(Sema &S,
// to unwrap. This essentially mimics what
// IsQualificationConversion does, but here we're checking for a
// strict subset of qualifiers.
- if (T1.getCVRQualifiers() == T2.getCVRQualifiers())
+ if (T1.getQualifiers().withoutObjCLifetime() ==
+ T2.getQualifiers().withoutObjCLifetime())
// The qualifiers are the same, so this doesn't tell us anything
// about how the sequences rank.
+ // ObjC ownership quals are omitted above as they interfere with
+ // the ARC overload rule.
;
else if (T2.isMoreQualifiedThan(T1)) {
// T1 has fewer qualifiers, so it could be the better sequence.