[cfe-commits] r71191 - in /cfe/branches/Apple/Dib: lib/Sema/SemaType.cpp test/Sema/block-misc.c
Mike Stump
mrs at apple.com
Thu May 7 16:09:19 PDT 2009
Author: mrs
Date: Thu May 7 18:09:18 2009
New Revision: 71191
URL: http://llvm.org/viewvc/llvm-project?rev=71191&view=rev
Log:
Merge in 71183:
Allow qualifiers on blocks. Radar 6441502
Modified:
cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp
cfe/branches/Apple/Dib/test/Sema/block-misc.c
Modified: cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp?rev=71191&r1=71190&r2=71191&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp (original)
+++ cfe/branches/Apple/Dib/lib/Sema/SemaType.cpp Thu May 7 18:09:18 2009
@@ -666,12 +666,11 @@
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())
Diag(D.getIdentifierLoc(), diag::err_nonfunction_block_type);
else
- T = Context.getBlockPointerType(T);
+ T = (Context.getBlockPointerType(T)
+ .getQualifiedType(DeclType.Cls.TypeQuals));
break;
case DeclaratorChunk::Pointer:
T = BuildPointerType(T, DeclType.Ptr.TypeQuals, DeclType.Loc, Name);
Modified: cfe/branches/Apple/Dib/test/Sema/block-misc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/Sema/block-misc.c?rev=71191&r1=71190&r2=71191&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/test/Sema/block-misc.c (original)
+++ cfe/branches/Apple/Dib/test/Sema/block-misc.c Thu May 7 18:09:18 2009
@@ -180,3 +180,8 @@
(void)(1 < bp); // expected-error {{invalid operands to binary expression}}
(void)(0 < bp); // expected-error {{invalid operands to binary expression}}
}
+
+void test18() {
+ void (^const blockA)(void) = ^{ };
+ blockA = ^{ }; // expected-error {{read-only variable is not assignable}}
+}
More information about the cfe-commits
mailing list