summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-09-05 22:11:13 +0000
committerSteve Naroff <snaroff@apple.com>2008-09-05 22:11:13 +0000
commit8de9c3affe72973ac5ca8a660a10a7fe45fc31cd (patch)
treef4cfeb4a55a457be603c3b9e65d84d32b351a57b /clang/lib/AST/ASTContext.cpp
parentd94269f90662c46410f244db8b7803ce019f4300 (diff)
downloadbcm5719-llvm-8de9c3affe72973ac5ca8a660a10a7fe45fc31cd.tar.gz
bcm5719-llvm-8de9c3affe72973ac5ca8a660a10a7fe45fc31cd.zip
More type checking for blocks. Still incomplete (will hopefully finish up this weekend).
llvm-svn: 55862
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 4caf16c4b09..62364bab318 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -1781,7 +1781,19 @@ bool ASTContext::isObjCObjectPointerType(QualType Ty) const {
//===----------------------------------------------------------------------===//
/// typesAreBlockCompatible - This routine is called when comparing two
-/// block types. Types must be strictly compatible here.
+/// block types. Types must be strictly compatible here. For example,
+/// C unfortunately doesn't produce an error for the following:
+///
+/// int (*emptyArgFunc)();
+/// int (*intArgList)(int) = emptyArgFunc;
+///
+/// For blocks, we will produce an error for the following (similar to C++):
+///
+/// int (^emptyArgBlock)();
+/// int (^intArgBlock)(int) = emptyArgBlock;
+///
+/// FIXME: When the dust settles on this integration, fold this into mergeTypes.
+///
bool ASTContext::typesAreBlockCompatible(QualType lhs, QualType rhs) {
if (lhs.getCVRQualifiers() != rhs.getCVRQualifiers())
return false;
OpenPOWER on IntegriCloud