intel / opencl-clang

Other
136 stars 62 forks source link

Port "Enable use of GNU C extension - const statement expression as array size" #459

Closed AGindinson closed 1 year ago

AGindinson commented 1 year ago

This patch partially reverts the commit: https://github.com/llvm/llvm-project/commit/6781fee085058913444e0c5937da9c0e7e928db5

For backward compatibility, we still need to support the expressions like:

const int size = ({ false; }) ? 0 : 1;
float array[size];

https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

This is a cherry-pick of commit bf679f4 from CClang 14 branch.