Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension. We don't and
will hopefully never support this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59460 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c
index 62b774e..c4d0c2d 100644
--- a/test/Sema/block-misc.c
+++ b/test/Sema/block-misc.c
@@ -30,7 +30,7 @@
int test2(double (^S)()) {
double (^I)(int) = (void*) S;
- (void*)I = (void *)S; // expected-error {{expression is not assignable}}
+ (void*)I = (void *)S; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
void *pv = I;
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c
index c98a7ed..8c8adc6 100644
--- a/test/Sema/exprs.c
+++ b/test/Sema/exprs.c
@@ -24,3 +24,8 @@
var = -5;
}
+// rdar://6319320
+void test5(int *X, float *P) {
+ (float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
+}
+