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/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index a5066a8..0506b40 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2345,6 +2345,10 @@
Diag(loc, diag::err_typecheck_non_object_not_modifiable_lvalue,
lhsType.getAsString(), lex->getSourceRange());
return QualType();
+ case Expr::MLV_LValueCast:
+ Diag(loc, diag::err_typecheck_lvalue_casts_not_supported,
+ lex->getSourceRange());
+ return QualType();
case Expr::MLV_InvalidExpression:
Diag(loc, diag::err_typecheck_expression_not_modifiable_lvalue,
lex->getSourceRange());