[all-commits] [llvm/llvm-project] 26068c: [libc++] <type_traits>: Avoid instantiating a poin...

John Baldwin via All-commits all-commits at lists.llvm.org
Mon Nov 21 14:34:42 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 26068c6e60324ed866a1ca2afb5cb5eb0aaf015b
      https://github.com/llvm/llvm-project/commit/26068c6e60324ed866a1ca2afb5cb5eb0aaf015b
  Author: John Baldwin <jhb at FreeBSD.org>
  Date:   2022-11-21 (Mon, 21 Nov 2022)

  Changed paths:
    M libcxx/include/__type_traits/decay.h
    M libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp

  Log Message:
  -----------
  [libc++] <type_traits>: Avoid instantiating a pointer type.

GCC expands the pointer type in this conditional expression even for
template types _Up that are not arrays.  This raises an error when
std::decay<> is used with reference types (as is done in LLVM's
sources).  Using add_pointer<> causes GCC to only instantiate a
pointer type for array types.

Reviewed By: #libc, philnik, ldionne

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




More information about the All-commits mailing list