[clang] [Clang] [Frontend] fix crash on parsing ternary operator with `vector_size` condition (PR #102004)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 08:53:23 PDT 2024


================
@@ -169,10 +173,10 @@ void all_dependent(Cond C, LHS L, RHS R) {
 void Templates() {
   dependent_cond(two_ints);
   dependent_operand(two_floats);
-  // expected-error at 165 {{vector operands to the vector conditional must be the same type ('__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int' (vector of 4 'unsigned int' values) and '__attribute__((__vector_size__(4 * sizeof(double)))) double' (vector of 4 'double' values))}}}
+  // expected-error at 169 {{vector operands to the vector conditional must be the same type ('__attribute__((__vector_size__(4 * sizeof(unsigned int)))) unsigned int' (vector of 4 'unsigned int' values) and '__attribute__((__vector_size__(4 * sizeof(double)))) double' (vector of 4 'double' values))}}}
----------------
AaronBallman wrote:

To save ourselves headaches in the future, I would recommend a slightly different change here. On line 169, put a comment: `// #dep_conditional` and on these two lines, switch the comment to `// expected-error@#dep_conditional`

Then we can modify the test without needing to update these two diagnostics due to line number differences.

https://github.com/llvm/llvm-project/pull/102004


More information about the cfe-commits mailing list