[all-commits] [llvm/llvm-project] 6bb3a3: [clang] Improve diagnostics for `__builtin_align` ...

🍌Shawn via All-commits all-commits at lists.llvm.org
Fri Apr 17 22:06:29 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bb3a3563025d55177e5416277c52cb1801ec2c1
      https://github.com/llvm/llvm-project/commit/6bb3a3563025d55177e5416277c52cb1801ec2c1
  Author: 🍌Shawn <m18824909883 at 163.com>
  Date:   2026-04-18 (Sat, 18 Apr 2026)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/Sema/builtin-align.c
    M clang/test/SemaCXX/builtin-align-cxx.cpp

  Log Message:
  -----------
  [clang] Improve diagnostics for `__builtin_align` builtins with floating/member pointer operands (#192650)

Improve diagnostics for `__builtin_align_up`, `__builtin_align_down`,
and `__builtin_is_aligned` when the first operand has an invalid type.

Clang already emits `err_typecheck_expect_scalar_operand` for
unsupported operands, but the message is generic. This patch adds
follow-up notes to clarify three common invalid cases:

* floating point operands (“floating point types are not allowed here”)
* C++ member pointer operands (“member pointers are not allowed here”)
* plain-function-pointer ("function pointers are not allowed here")



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list