diff --git a/llvm/docs/CodingStandards.rst b/llvm/docs/CodingStandards.rst --- a/llvm/docs/CodingStandards.rst +++ b/llvm/docs/CodingStandards.rst @@ -1263,6 +1263,14 @@ bool NewToSet = Myset.insert(Value); (void)NewToSet; assert(NewToSet && "The value shouldn't be in the set yet"); +Prefer C++-style casts +^^^^^^^^^^^^^^^^^^^^^^ + +When casting, use ``static_cast``, ``reinterpret_cast``, and ``const_cast`` +rather than C-style casts. The sole exception to this is when casting to void to +suppress warnings about unused variables (as an alternative to +``[[maybe_unused]]``), when C-style casts should be preferred instead. + Do Not Use ``using namespace std`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^