Skip to content

Commit ab31b77

Browse files
committedFeb 14, 2018
Convert an assert to a static_assert. NFC.
Differential Revision: https://reviews.llvm.org/D43305 llvm-svn: 325158
1 parent 24be43d commit ab31b77

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎lld/COFF/Symbols.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,8 @@ void replaceSymbol(Symbol *S, ArgT &&... Arg) {
421421
static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
422422
static_assert(alignof(T) <= alignof(SymbolUnion),
423423
"SymbolUnion not aligned enough");
424-
assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
425-
"Not a Symbol");
424+
static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr,
425+
"Not a Symbol");
426426
new (S) T(std::forward<ArgT>(Arg)...);
427427
}
428428
} // namespace coff

‎lld/ELF/Symbols.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ void replaceSymbol(Symbol *S, ArgT &&... Arg) {
355355
static_assert(sizeof(T) <= sizeof(SymbolUnion), "SymbolUnion too small");
356356
static_assert(alignof(T) <= alignof(SymbolUnion),
357357
"SymbolUnion not aligned enough");
358-
assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
359-
"Not a Symbol");
358+
static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr,
359+
"Not a Symbol");
360360

361361
Symbol Sym = *S;
362362

‎lld/wasm/Symbols.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ T *replaceSymbol(Symbol *S, ArgT &&... Arg) {
242242
static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
243243
static_assert(alignof(T) <= alignof(SymbolUnion),
244244
"SymbolUnion not aligned enough");
245-
assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
246-
"Not a Symbol");
245+
static_assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr,
246+
"Not a Symbol");
247247
return new (S) T(std::forward<ArgT>(Arg)...);
248248
}
249249

0 commit comments

Comments
 (0)
Please sign in to comment.