Fix altivec regression caused by D115670 in Vec Const Eval
authorErich Keane <erich.keane@intel.com>
Tue, 4 Jan 2022 17:28:22 +0000 (09:28 -0800)
committerErich Keane <erich.keane@intel.com>
Tue, 4 Jan 2022 17:53:26 +0000 (09:53 -0800)
commit2edc21e8566be8fa9b20e0bb71a83af90ec9aa97
treeacc3f3dd5e8610925650756c37350eabcdbbb2f2
parentb061d86c6930acef1b246874adf2f11e9120894c
Fix altivec regression caused by D115670 in Vec Const Eval

The Vector Constant Evaluator assumes that all the types of its
sub-expressions are going to be Vector APValues, which holds for most
situations.  However, in the 1 examples of Altivec C compilation of
operator ++ (not allowed for other vector types), the result is an
LValue.

Since the operator isn't supported for constant evaluation anyway, this
patch just fails-out of constant eval if we are in a situation where the
operand to the unary operator causes an LValue.
clang/lib/AST/ExprConstant.cpp
clang/test/Sema/altivec-init.c