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 | 785359525354436f91455f7d5bf5cbe36bdbd227 (patch) | |
tree | 46ada76456c5597796250555f6e58b3c12a81881 /clang/lib | |
parent | 9a624fa993e061e5926a7f044bc39fb06000e5f5 (diff) | |
download | bcm5719-llvm-785359525354436f91455f7d5bf5cbe36bdbd227.tar.gz bcm5719-llvm-785359525354436f91455f7d5bf5cbe36bdbd227.zip |
Allow GC qualifiers to be added/removed by conversions from/to void*
without a warning.
llvm-svn: 128328
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index c2f3a434b81..dbddc384512 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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; |