Skip to content

Commit

Permalink
AK: Fix naming conflict with compiler builtin
Browse files Browse the repository at this point in the history
Clang patch D116203 added various builtin functions for type traits,
`__decay` being one of them. This name conflicts with our
`AK::Detail::__decay`, leading to compiler warnings with Clang 16.
  • Loading branch information
BertalanD authored and awesomekling committed Oct 1, 2022
1 parent 41a8f3f commit 01c2cff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions AK/StdLibExtraDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,20 +567,20 @@ template<template<typename...> typename U, typename... Us>
inline constexpr bool IsSpecializationOf<U<Us...>, U> = true;

template<typename T>
struct __decay {
struct __Decay {
typedef Detail::RemoveCVReference<T> type;
};
template<typename T>
struct __decay<T[]> {
struct __Decay<T[]> {
typedef T* type;
};
template<typename T, decltype(sizeof(T)) N>
struct __decay<T[N]> {
struct __Decay<T[N]> {
typedef T* type;
};
// FIXME: Function decay
template<typename T>
using Decay = typename __decay<T>::type;
using Decay = typename __Decay<T>::type;

template<typename T, typename U>
inline constexpr bool IsPointerOfType = IsPointer<Decay<U>>&& IsSame<T, RemoveCV<RemovePointer<Decay<U>>>>;
Expand Down

0 comments on commit 01c2cff

Please sign in to comment.