diff options
author | Steve Naroff <snaroff@apple.com> | 2008-08-27 16:04:49 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-08-27 16:04:49 +0000 |
commit | 5618bd4a52c45fbbb605e3ba885663b2164db8a3 (patch) | |
tree | de48c6a25701bf5c027d7af42054e9a0c25e523b /lib/Sema/SemaType.cpp | |
parent | 30ad167f74cb8a04c35ced6c69b116f15d104f8e (diff) |
First wave of changes to support "blocks" (an extension to C).
This commit adds the declaration syntax (and associated type).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55417 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index c7876b1151..209a003988 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -253,6 +253,14 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) { DeclaratorChunk &DeclType = D.getTypeObject(e-i-1); switch (DeclType.Kind) { default: assert(0 && "Unknown decltype!"); + case DeclaratorChunk::BlockPointer: + if (DeclType.Cls.TypeQuals) + Diag(D.getIdentifierLoc(), diag::err_qualified_block_pointer_type); + if (!T.getTypePtr()->isFunctionType()) + Diag(D.getIdentifierLoc(), diag::err_nonfunction_block_type); + else + T = Context.getBlockPointerType(T); + break; case DeclaratorChunk::Pointer: if (T->isReferenceType()) { // C++ 8.3.2p4: There shall be no ... pointers to references ... |