[all-commits] [llvm/llvm-project] 0be41e: [LLVM][Casting.h] Don't create a temporary while c...

Aman LaChapelle via All-commits all-commits at lists.llvm.org
Thu May 12 20:11:19 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0be41ed5bb57aded4e8ca1c6a8d22b7830c8f2fc
      https://github.com/llvm/llvm-project/commit/0be41ed5bb57aded4e8ca1c6a8d22b7830c8f2fc
  Author: bzcheeseman <aman.lachapelle at gmail.com>
  Date:   2022-05-12 (Thu, 12 May 2022)

  Changed paths:
    M llvm/include/llvm/Support/Casting.h
    M llvm/unittests/Support/Casting.cpp

  Log Message:
  -----------
  [LLVM][Casting.h] Don't create a temporary while casting.

C-style casting can create a temporary when compiled by a C++ compiler, which was emitting a warning casting a reference to another reference. We can't use C++-style casting directly because it doesn't always work with incomplete types. In order to support the current use-cases, for references we switch to pointer space to perform the cast.

Reviewed By: qiongsiwu1

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




More information about the All-commits mailing list