[all-commits] [llvm/llvm-project] ac7a9e: Resolve overload ambiguity on Mac OS when printing...

Aaron Puchert via All-commits all-commits at lists.llvm.org
Sat May 14 03:38:05 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac7a9ef0ae3a5c63dc4e641f9912d8b659ebd720
      https://github.com/llvm/llvm-project/commit/ac7a9ef0ae3a5c63dc4e641f9912d8b659ebd720
  Author: Aaron Puchert <aaron.puchert at sap.com>
  Date:   2022-05-14 (Sat, 14 May 2022)

  Changed paths:
    M clang/include/clang/Basic/Diagnostic.h
    M clang/lib/AST/CommentParser.cpp

  Log Message:
  -----------
  Resolve overload ambiguity on Mac OS when printing size_t in diagnostics

Precommit builds cover Linux and Windows, but this ambiguity would only
show up on Mac OS: there we have int32_t = int, int64_t = long long and
size_t = unsigned long. So printing a size_t, while successful on the
other two architectures, cannot be unambiguously resolved on Mac OS.

This is not really meant to support printing arguments of type long or
size_t, but more as a way to prevent build breakage that would not be
detected in precommit builds, as happened in D125429.

Technically we have no guarantee that one of these types has the 64 bits
that afdac5fbcb6a3 wanted to provide, so proposals are welcome. We do
have a guarantee though that these three types are different, so we
should be fine with overload resolution.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D125580




More information about the All-commits mailing list