[all-commits] [llvm/llvm-project] 343bed: Canonically identical types are allowed in compoun...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Sat Oct 14 08:04:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 343bed8d3a9b632594a3f786bbb189613975d51e
      https://github.com/llvm/llvm-project/commit/343bed8d3a9b632594a3f786bbb189613975d51e
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2023-10-14 (Sat, 14 Oct 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/Sema/conditional.c

  Log Message:
  -----------
  Canonically identical types are allowed in compound expressions in C

We did not have a catch-all for when the two operand types are
identical after canonicalization. Instead, we handled that on a case by
case basis. Thus, we would diagnose code like:
```
mat4 test(int a) {
  typedef float mat4 __attribute((matrix_type(4, 4)));
  mat4 transform;
  return (a > 0) ? transform : transform;
}
```
This simplifies the logic and will be more forwards
compatible with other extended datatypes.

Fixes https://github.com/llvm/llvm-project/issues/69008




More information about the All-commits mailing list