[cfe-commits] r62240 - in /cfe/trunk: lib/Parse/ParseExpr.cpp test/Sema/block-syntax-error.c
Fariborz Jahanian
fjahanian at apple.com
Wed Jan 14 11:39:54 PST 2009
Author: fjahanian
Date: Wed Jan 14 13:39:53 2009
New Revision: 62240
URL: http://llvm.org/viewvc/llvm-project?rev=62240&view=rev
Log:
Patch to keep clang honest that it does not yet support
explicit return type on block literals.
Added:
cfe/trunk/test/Sema/block-syntax-error.c
Modified:
cfe/trunk/lib/Parse/ParseExpr.cpp
Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=62240&r1=62239&r2=62240&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Wed Jan 14 13:39:53 2009
@@ -1239,6 +1239,11 @@
Actions.ActOnBlockError(CaretLoc, CurScope);
}
}
+ else {
+ // Saw something like: ^expr
+ Diag(Tok, diag::err_expected_expression);
+ return ExprError();
+ }
return move(Result);
}
Added: cfe/trunk/test/Sema/block-syntax-error.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-syntax-error.c?rev=62240&view=auto
==============================================================================
--- cfe/trunk/test/Sema/block-syntax-error.c (added)
+++ cfe/trunk/test/Sema/block-syntax-error.c Wed Jan 14 13:39:53 2009
@@ -0,0 +1,9 @@
+// RUN: clang %s -fsyntax-only -verify -fblocks
+
+void (^noop)(void);
+
+void somefunction() {
+ noop = ^int *{}; // expected-error {{expected expression}}
+
+ noop = ^noop; // expected-error {{expected expression}}
+}
More information about the cfe-commits
mailing list