[lld] r325183 - Revert r325158: Convert an assert to a static_assert. NFC.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 10:20:56 PST 2018


Might be handy to have a link to the buildbot failure and/or quote the
error messages in the commit message for reference (so someone else can
confirm the error they're seeing is the same one being addressed here, or
ensure they don't make the same mistake with a similar refactor, etc)

On Wed, Feb 14, 2018 at 2:45 PM Rui Ueyama via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: ruiu
> Date: Wed Feb 14 14:43:43 2018
> New Revision: 325183
>
> URL: http://llvm.org/viewvc/llvm-project?rev=325183&view=rev
> Log:
> Revert r325158: Convert an assert to a static_assert. NFC.
>
> This reverts commit r325158 because it broke GCC builds.
>
> Modified:
>     lld/trunk/COFF/Symbols.h
>     lld/trunk/ELF/Symbols.h
>     lld/trunk/wasm/Symbols.h
>
> Modified: lld/trunk/COFF/Symbols.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Symbols.h?rev=325183&r1=325182&r2=325183&view=diff
>
> ==============================================================================
> --- lld/trunk/COFF/Symbols.h (original)
> +++ lld/trunk/COFF/Symbols.h Wed Feb 14 14:43:43 2018
> @@ -421,8 +421,8 @@ void replaceSymbol(Symbol *S, ArgT &&...
>    static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
>    static_assert(alignof(T) <= alignof(SymbolUnion),
>                  "SymbolUnion not aligned enough");
> -  static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) ==
> nullptr,
> -                "Not a Symbol");
> +  assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
> +         "Not a Symbol");
>    new (S) T(std::forward<ArgT>(Arg)...);
>  }
>  } // namespace coff
>
> Modified: lld/trunk/ELF/Symbols.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=325183&r1=325182&r2=325183&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Symbols.h (original)
> +++ lld/trunk/ELF/Symbols.h Wed Feb 14 14:43:43 2018
> @@ -355,8 +355,8 @@ void replaceSymbol(Symbol *S, ArgT &&...
>    static_assert(sizeof(T) <= sizeof(SymbolUnion), "SymbolUnion too
> small");
>    static_assert(alignof(T) <= alignof(SymbolUnion),
>                  "SymbolUnion not aligned enough");
> -  static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) ==
> nullptr,
> -                "Not a Symbol");
> +  assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
> +         "Not a Symbol");
>
>    Symbol Sym = *S;
>
>
> Modified: lld/trunk/wasm/Symbols.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Symbols.h?rev=325183&r1=325182&r2=325183&view=diff
>
> ==============================================================================
> --- lld/trunk/wasm/Symbols.h (original)
> +++ lld/trunk/wasm/Symbols.h Wed Feb 14 14:43:43 2018
> @@ -240,8 +240,8 @@ T *replaceSymbol(Symbol *S, ArgT &&... A
>    static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
>    static_assert(alignof(T) <= alignof(SymbolUnion),
>                  "SymbolUnion not aligned enough");
> -  static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) ==
> nullptr,
> -                "Not a Symbol");
> +  assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
> +         "Not a Symbol");
>    return new (S) T(std::forward<ArgT>(Arg)...);
>  }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180220/e00cee7e/attachment.html>


More information about the llvm-commits mailing list