diff options
author | John McCall <rjmccall@apple.com> | 2011-03-26 02:56:45 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-03-26 02:56:45 +0000 |
commit | 2234873111009eb8655d63362cedc422eb9fc517 (patch) | |
tree | c6290ae77b59e7a592c50731b7460525fda22f9a /lib/Sema/SemaExpr.cpp | |
parent | 379246d29b1c7ef2659beadf41b4cb79806c0e63 (diff) |
Allow GC qualifiers to be added/removed by conversions from/to void*
without a warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index c2f3a434b8..dbddc38451 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -5803,6 +5803,12 @@ checkPointerTypesForAssignment(Sema &S, QualType lhsType, QualType rhsType) { if (lhq.getAddressSpace() != rhq.getAddressSpace()) ConvTy = Sema::IncompatiblePointerDiscardsQualifiers; + // It's okay to add or remove GC qualifiers when converting to + // and from void*. + else if (lhq.withoutObjCGCAttr().compatiblyIncludes(rhq.withoutObjCGCAttr()) + && (lhptee->isVoidType() || rhptee->isVoidType())) + ; // keep old + // For GCC compatibility, other qualifier mismatches are treated // as still compatible in C. else ConvTy = Sema::CompatiblePointerDiscardsQualifiers; |