Skip to content

CheriRangeChecker: C++20 aggregate type rules#803

Merged
nwf merged 1 commit intoCTSRD-CHERI:devfrom
nwf:202601-cherirangechecker_cxx20
Jan 7, 2026
Merged

CheriRangeChecker: C++20 aggregate type rules#803
nwf merged 1 commit intoCTSRD-CHERI:devfrom
nwf:202601-cherirangechecker_cxx20

Conversation

@nwf
Copy link
Member

@nwf nwf commented Jan 6, 2026

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,

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,
@nwf nwf requested a review from arichardson January 6, 2026 18:29
@nwf nwf merged commit 848e3dd into CTSRD-CHERI:dev Jan 7, 2026
7 checks passed
@nwf nwf deleted the 202601-cherirangechecker_cxx20 branch January 7, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments