[PATCH] D43305: Convert an assert to a static_assert. NFC.
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 11:33:05 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL325158: Convert an assert to a static_assert. NFC. (authored by sbc, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D43305
Files:
lld/trunk/COFF/Symbols.h
lld/trunk/ELF/Symbols.h
lld/trunk/wasm/Symbols.h
Index: lld/trunk/COFF/Symbols.h
===================================================================
--- lld/trunk/COFF/Symbols.h
+++ lld/trunk/COFF/Symbols.h
@@ -421,8 +421,8 @@
static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
static_assert(alignof(T) <= alignof(SymbolUnion),
"SymbolUnion not aligned enough");
- assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
- "Not a Symbol");
+ static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr,
+ "Not a Symbol");
new (S) T(std::forward<ArgT>(Arg)...);
}
} // namespace coff
Index: lld/trunk/wasm/Symbols.h
===================================================================
--- lld/trunk/wasm/Symbols.h
+++ lld/trunk/wasm/Symbols.h
@@ -242,8 +242,8 @@
static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
static_assert(alignof(T) <= alignof(SymbolUnion),
"SymbolUnion not aligned enough");
- assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
- "Not a Symbol");
+ static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr,
+ "Not a Symbol");
return new (S) T(std::forward<ArgT>(Arg)...);
}
Index: lld/trunk/ELF/Symbols.h
===================================================================
--- lld/trunk/ELF/Symbols.h
+++ lld/trunk/ELF/Symbols.h
@@ -355,8 +355,8 @@
static_assert(sizeof(T) <= sizeof(SymbolUnion), "SymbolUnion too small");
static_assert(alignof(T) <= alignof(SymbolUnion),
"SymbolUnion not aligned enough");
- assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
- "Not a Symbol");
+ static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr,
+ "Not a Symbol");
Symbol Sym = *S;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43305.134279.patch
Type: text/x-patch
Size: 1847 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180214/22b2bd2b/attachment.bin>
More information about the llvm-commits
mailing list