Skip to content

Commit 32aa35b

Browse files
Drop empty string literals from static_assert (NFC)
Identified with modernize-unary-static-assert.
1 parent baee196 commit 32aa35b

File tree

20 files changed

+55
-57
lines changed

20 files changed

+55
-57
lines changed

bolt/include/bolt/Core/BinaryBasicBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ class BinaryBasicBlock {
985985
#if defined(LLVM_ON_UNIX)
986986
/// Keep the size of the BinaryBasicBlock within a reasonable size class
987987
/// (jemalloc bucket) on Linux
988-
static_assert(sizeof(BinaryBasicBlock) <= 256, "");
988+
static_assert(sizeof(BinaryBasicBlock) <= 256);
989989
#endif
990990

991991
bool operator<(const BinaryBasicBlock &LHS, const BinaryBasicBlock &RHS);

clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct AllHeuristicsBoundsWellConfigured {
9090
1>::Value;
9191
};
9292

93-
static_assert(AllHeuristicsBoundsWellConfigured::Value, "");
93+
static_assert(AllHeuristicsBoundsWellConfigured::Value);
9494
} // namespace
9595

9696
static constexpr llvm::StringLiteral DefaultAbbreviations = "addr=address;"

clang-tools-extra/clangd/Quality.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ evaluateDecisionForest(const SymbolQualitySignals &Quality,
591591
// Produces an integer that sorts in the same order as F.
592592
// That is: a < b <==> encodeFloat(a) < encodeFloat(b).
593593
static uint32_t encodeFloat(float F) {
594-
static_assert(std::numeric_limits<float>::is_iec559, "");
594+
static_assert(std::numeric_limits<float>::is_iec559);
595595
constexpr uint32_t TopBit = ~(~uint32_t{0} >> 1);
596596

597597
// Get the bits of the float. Endianness is the same as for integers.

clang-tools-extra/pseudo/include/clang-pseudo/Forest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class alignas(class ForestNode *) ForestNode {
157157
// An array of ForestNode* following the object.
158158
};
159159
// ForestNode may not be destroyed (for BumpPtrAllocator).
160-
static_assert(std::is_trivially_destructible<ForestNode>(), "");
160+
static_assert(std::is_trivially_destructible<ForestNode>());
161161

162162
// A memory arena for the parse forest.
163163
class ForestArena {

lld/MachO/SyntheticSections.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void sha256(const uint8_t *data, size_t len, uint8_t *output) {
5858
#else
5959
ArrayRef<uint8_t> block(data, len);
6060
std::array<uint8_t, 32> hash = SHA256::hash(block);
61-
static_assert(hash.size() == CodeSignatureSection::hashSize, "");
61+
static_assert(hash.size() == CodeSignatureSection::hashSize);
6262
memcpy(output, hash.data(), hash.size());
6363
#endif
6464
}
@@ -1381,8 +1381,8 @@ void StringTableSection::writeTo(uint8_t *buf) const {
13811381
}
13821382
}
13831383

1384-
static_assert((CodeSignatureSection::blobHeadersSize % 8) == 0, "");
1385-
static_assert((CodeSignatureSection::fixedHeadersSize % 8) == 0, "");
1384+
static_assert((CodeSignatureSection::blobHeadersSize % 8) == 0);
1385+
static_assert((CodeSignatureSection::fixedHeadersSize % 8) == 0);
13861386

13871387
CodeSignatureSection::CodeSignatureSection()
13881388
: LinkEditSection(segment_names::linkEdit, section_names::codeSignature) {

lld/MachO/SyntheticSections.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ class WordLiteralSection final : public SyntheticSection {
581581
using UInt128 = std::pair<uint64_t, uint64_t>;
582582
// I don't think the standard guarantees the size of a pair, so let's make
583583
// sure it's exact -- that way we can construct it via `mmap`.
584-
static_assert(sizeof(UInt128) == 16, "");
584+
static_assert(sizeof(UInt128) == 16);
585585

586586
WordLiteralSection();
587587
void addInput(WordLiteralInputSection *);

lld/MachO/UnwindInfoSection.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,11 +394,9 @@ static bool canFoldEncoding(compact_unwind_encoding_t encoding) {
394394
// unwind info can't be folded if it's using this encoding since both
395395
// entries need unique addresses.
396396
static_assert(static_cast<uint32_t>(UNWIND_X86_64_MODE_MASK) ==
397-
static_cast<uint32_t>(UNWIND_X86_MODE_MASK),
398-
"");
397+
static_cast<uint32_t>(UNWIND_X86_MODE_MASK));
399398
static_assert(static_cast<uint32_t>(UNWIND_X86_64_MODE_STACK_IND) ==
400-
static_cast<uint32_t>(UNWIND_X86_MODE_STACK_IND),
401-
"");
399+
static_cast<uint32_t>(UNWIND_X86_MODE_STACK_IND));
402400
if ((target->cpuType == CPU_TYPE_X86_64 || target->cpuType == CPU_TYPE_X86) &&
403401
(encoding & UNWIND_X86_64_MODE_MASK) == UNWIND_X86_64_MODE_STACK_IND) {
404402
// FIXME: Consider passing in the two function addresses and getting

llvm/include/llvm/ADT/APFloat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ class APFloat : public APFloatBase {
702702
typedef detail::IEEEFloat IEEEFloat;
703703
typedef detail::DoubleAPFloat DoubleAPFloat;
704704

705-
static_assert(std::is_standard_layout<IEEEFloat>::value, "");
705+
static_assert(std::is_standard_layout<IEEEFloat>::value);
706706

707707
union Storage {
708708
const fltSemantics *semantics;
@@ -795,7 +795,7 @@ class APFloat : public APFloatBase {
795795

796796
template <typename T> static bool usesLayout(const fltSemantics &Semantics) {
797797
static_assert(std::is_same<T, IEEEFloat>::value ||
798-
std::is_same<T, DoubleAPFloat>::value, "");
798+
std::is_same<T, DoubleAPFloat>::value);
799799
if (std::is_same<T, DoubleAPFloat>::value) {
800800
return &Semantics == &PPCDoubleDouble();
801801
}

llvm/include/llvm/Analysis/CmpInstAnalysis.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@ namespace llvm {
6464
assert(CmpInst::FCMP_FALSE <= CC && CC <= CmpInst::FCMP_TRUE &&
6565
"Unexpected FCmp predicate!");
6666
// Take advantage of the bit pattern of CmpInst::Predicate here.
67-
// U L G E
68-
static_assert(CmpInst::FCMP_FALSE == 0, ""); // 0 0 0 0
69-
static_assert(CmpInst::FCMP_OEQ == 1, ""); // 0 0 0 1
70-
static_assert(CmpInst::FCMP_OGT == 2, ""); // 0 0 1 0
71-
static_assert(CmpInst::FCMP_OGE == 3, ""); // 0 0 1 1
72-
static_assert(CmpInst::FCMP_OLT == 4, ""); // 0 1 0 0
73-
static_assert(CmpInst::FCMP_OLE == 5, ""); // 0 1 0 1
74-
static_assert(CmpInst::FCMP_ONE == 6, ""); // 0 1 1 0
75-
static_assert(CmpInst::FCMP_ORD == 7, ""); // 0 1 1 1
76-
static_assert(CmpInst::FCMP_UNO == 8, ""); // 1 0 0 0
77-
static_assert(CmpInst::FCMP_UEQ == 9, ""); // 1 0 0 1
78-
static_assert(CmpInst::FCMP_UGT == 10, ""); // 1 0 1 0
79-
static_assert(CmpInst::FCMP_UGE == 11, ""); // 1 0 1 1
80-
static_assert(CmpInst::FCMP_ULT == 12, ""); // 1 1 0 0
81-
static_assert(CmpInst::FCMP_ULE == 13, ""); // 1 1 0 1
82-
static_assert(CmpInst::FCMP_UNE == 14, ""); // 1 1 1 0
83-
static_assert(CmpInst::FCMP_TRUE == 15, ""); // 1 1 1 1
67+
// U L G E
68+
static_assert(CmpInst::FCMP_FALSE == 0); // 0 0 0 0
69+
static_assert(CmpInst::FCMP_OEQ == 1); // 0 0 0 1
70+
static_assert(CmpInst::FCMP_OGT == 2); // 0 0 1 0
71+
static_assert(CmpInst::FCMP_OGE == 3); // 0 0 1 1
72+
static_assert(CmpInst::FCMP_OLT == 4); // 0 1 0 0
73+
static_assert(CmpInst::FCMP_OLE == 5); // 0 1 0 1
74+
static_assert(CmpInst::FCMP_ONE == 6); // 0 1 1 0
75+
static_assert(CmpInst::FCMP_ORD == 7); // 0 1 1 1
76+
static_assert(CmpInst::FCMP_UNO == 8); // 1 0 0 0
77+
static_assert(CmpInst::FCMP_UEQ == 9); // 1 0 0 1
78+
static_assert(CmpInst::FCMP_UGT == 10); // 1 0 1 0
79+
static_assert(CmpInst::FCMP_UGE == 11); // 1 0 1 1
80+
static_assert(CmpInst::FCMP_ULT == 12); // 1 1 0 0
81+
static_assert(CmpInst::FCMP_ULE == 13); // 1 1 0 1
82+
static_assert(CmpInst::FCMP_UNE == 14); // 1 1 1 0
83+
static_assert(CmpInst::FCMP_TRUE == 15); // 1 1 1 1
8484
return CC;
8585
}
8686

llvm/include/llvm/BinaryFormat/MachO.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2342,7 +2342,7 @@ struct CS_CodeDirectory {
23422342
uint64_t execSegFlags; /* executable segment flags */
23432343
};
23442344

2345-
static_assert(sizeof(CS_CodeDirectory) == 88, "");
2345+
static_assert(sizeof(CS_CodeDirectory) == 88);
23462346

23472347
struct CS_BlobIndex {
23482348
uint32_t type; /* type of entry */

0 commit comments

Comments
 (0)