Skip to content

Commit 848e3dd

Browse files
committed
CheriRangeChecker: C++20 aggregate type rules
Remove the user-declared (but not user-provided) explicitly-defaulted (but not explicit) default constructors from ValueSource and AllocOperands so that these types are considered to be aggregate types under both C++11 and C++20. Relative to C++11, C++20 additionally precludes user-declared constructors on aggregates. Fixes, among others, the following build errors (where the code uses aggregate initialization syntax for these types): .../llvm/lib/Target/Mips/CheriRangeChecker.cpp:72:12: error: no matching constructor for initialization of 'ValueSource' 72 | return ValueSource{Src, Offset}; .../llvm/lib/Target/Mips/CheriRangeChecker.cpp:93:16: error: no matching constructor for initialization of 'AllocOperands' 93 | return AllocOperands{Malloc->getArgOperand(0), nullptr, Src,
1 parent bd3ac5d commit 848e3dd

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

llvm/lib/Target/Mips/CheriRangeChecker.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ namespace {
3030
// Operands for an allocation. Either one or two integers (constant or
3131
// variable). If there are two, then they must be multiplied together.
3232
struct ValueSource {
33-
ValueSource() = default;
3433
Value *Base = nullptr;
3534
int64_t Offset = 0;
3635
};
3736
struct AllocOperands {
38-
AllocOperands() = default;
3937
Value *Size = nullptr;
4038
Value *SizeMultiplier = nullptr;
4139
ValueSource ValueSrc;

0 commit comments

Comments
 (0)