summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-02-11 18:46:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-02-11 18:46:17 +0000
commit178259710ae45a1452deb64f40e714a2ad9175e7 (patch)
tree3c7a614982e920696f58c8a71b9cf4900d0f3020 /clang/lib/AST/ASTContext.cpp
parent00079d33742d215674b3211f353d65d7b1b6b224 (diff)
downloadbcm5719-llvm-178259710ae45a1452deb64f40e714a2ad9175e7.tar.gz
bcm5719-llvm-178259710ae45a1452deb64f40e714a2ad9175e7.zip
Fix a block sema bug where result type of initializer
is unqualified but its initialized is qualified. This is for c only and fixes the imm. problem. c++ is more involved and is wip. // rdar://8979379 llvm-svn: 125386
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 03c0abd3c62..dcbfd9deec5 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5076,9 +5076,14 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs,
// Check return type
QualType retType;
- if (OfBlockPointer)
- retType = mergeTypes(rbase->getResultType(), lbase->getResultType(), true,
- Unqualified);
+ if (OfBlockPointer) {
+ QualType RHS = rbase->getResultType();
+ QualType LHS = lbase->getResultType();
+ bool UnqualifiedResult = Unqualified;
+ if (!UnqualifiedResult)
+ UnqualifiedResult = (!RHS.hasQualifiers() && LHS.hasQualifiers());
+ retType = mergeTypes(RHS, LHS, true, UnqualifiedResult);
+ }
else
retType = mergeTypes(lbase->getResultType(), rbase->getResultType(), false,
Unqualified);
OpenPOWER on IntegriCloud