aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-27 04:18:06 +0000
committerChris Lattner <sabre@nondot.org>2009-03-27 04:18:06 +0000
commit9af5500f3f132f9a2f9abbe82113a7c7bb751472 (patch)
tree262b83444877ee284c509b5faa4507df10170370 /lib/Sema/SemaType.cpp
parent6fa9c38744b2332acf9f5a72658fa213f93158de (diff)
Fix rdar://6719156 - clang should emit a better error when blocks are disabled but are used anyway
by changing blocks from being disabled in the parser to being disabled in Sema. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index f14eb65203..dbe19e3434 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -625,6 +625,10 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip) {
switch (DeclType.Kind) {
default: assert(0 && "Unknown decltype!");
case DeclaratorChunk::BlockPointer:
+ // If blocks are disabled, emit an error.
+ if (!LangOpts.Blocks)
+ Diag(DeclType.Loc, diag::err_blocks_disable);
+
if (DeclType.Cls.TypeQuals)
Diag(D.getIdentifierLoc(), diag::err_qualified_block_pointer_type);
if (!T.getTypePtr()->isFunctionType())