This patch solves an error such as:
incompatible operand types ('vbool4_t' (aka '__rvv_bool4_t') and '__rvv_bool4_t')when one of the value is a TypedefType of the other value in ?:.
Differential D103603
[Sema][RISCV][SVE] Allow ?: to select Typedef BuiltinType in C Authored by arcbbb on Jun 3 2021, 3:01 AM.
Details This patch solves an error such as: incompatible operand types ('vbool4_t' (aka '__rvv_bool4_t') and '__rvv_bool4_t')when one of the value is a TypedefType of the other value in ?:.
Diff Detail
Event TimelineComment Actions Testcase for AArch64/SVE: #include <arm_sve.h>
svint8_t a();
__SVInt8_t b();
svint8_t foo(int cond){
return cond ? a(): b();
}Comment Actions The testcase I provided in last comment could be compile successfully with aarch64-gcc, but failed on clang. Comment Actions Thanks for the fix. I agree this is the right behaviour FWIW. I held off approving it in case there's another idiom that's preferred when comparing canonical types.
| ||||||
This is Context.hasSameType, and the braces are unnecessary.