extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69100
91177308-0d34-0410-b5e6-
96231b3b80d8
// lvalue, then this is probably a use of the old-school "cast as lvalue"
// GCC extension. We don't support it, but we want to produce good
// diagnostics when it happens so that the user knows why.
- if (const CStyleCastExpr *CE = dyn_cast<CStyleCastExpr>(this))
+ if (const CStyleCastExpr *CE = dyn_cast<CStyleCastExpr>(IgnoreParens()))
if (CE->getSubExpr()->isLvalue(Ctx) == LV_Valid)
return MLV_LValueCast;
return MLV_InvalidExpression;
// rdar://6319320
void test5(int *X, float *P) {
(float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
+ ((float*)X) = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
}
void test6() {