[NFC][Clang] Fix some comments in clang

Applying post commit comment suggestions from https://reviews.llvm.org/D114025
This commit is contained in:
Zarko Todorovski 2021-11-30 13:39:56 -05:00
parent ecaad4a876
commit 3ee685f98a
3 changed files with 9 additions and 7 deletions

View File

@ -515,7 +515,7 @@ public:
/// of the most derived class while we're in the base class. /// of the most derived class while we're in the base class.
VirtualBaseBranch, VirtualBaseBranch,
/// Number of different kinds, for validity checks. We subtract 1 so that /// Number of different kinds, for assertions. We subtract 1 so that
/// to keep receiving compiler warnings when we don't cover all enum values /// to keep receiving compiler warnings when we don't cover all enum values
/// in a switch. /// in a switch.
NumKindsMinusOne = VirtualBaseBranch NumKindsMinusOne = VirtualBaseBranch

View File

@ -5546,8 +5546,8 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
// For an arithmetic operation, the implied arithmetic must be well-formed. // For an arithmetic operation, the implied arithmetic must be well-formed.
if (Form == Arithmetic) { if (Form == Arithmetic) {
// GCC does not enforce these rules for GNU atomics, but we do, because if // GCC does not enforce these rules for GNU atomics, but we do to help catch
// we didn't it would be very confusing. FIXME: For whom? How so? // trivial type errors.
auto IsAllowedValueType = [&](QualType ValType) { auto IsAllowedValueType = [&](QualType ValType) {
if (ValType->isIntegerType()) if (ValType->isIntegerType())
return true; return true;
@ -5588,8 +5588,9 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
if (!IsC11 && !AtomTy.isTriviallyCopyableType(Context) && if (!IsC11 && !AtomTy.isTriviallyCopyableType(Context) &&
!AtomTy->isScalarType()) { !AtomTy->isScalarType()) {
// For GNU atomics, require a trivially-copyable type. This is not part of // For GNU atomics, require a trivially-copyable type. This is not part of
// the GNU atomics specification, but we enforce it, because if we didn't it // the GNU atomics specification but we enforce it for consistency with
// would be very confusing. FIXME: For whom? How so? // other atomics which generally all require a trivially-copyable type. This
// is because atomics just copy bits.
Diag(ExprRange.getBegin(), diag::err_atomic_op_needs_trivial_copy) Diag(ExprRange.getBegin(), diag::err_atomic_op_needs_trivial_copy)
<< Ptr->getType() << Ptr->getSourceRange(); << Ptr->getType() << Ptr->getSourceRange();
return ExprError(); return ExprError();

View File

@ -1508,8 +1508,9 @@ Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo,
} }
// Only construct objects with object types. // Only construct objects with object types.
// There doesn't seem to be an explicit rule for this but functions are // The standard doesn't explicitly forbid function types here, but that's an
// not objects, so they cannot take initializers. // obvious oversight, as there's no way to dynamically construct a function
// in general.
if (Ty->isFunctionType()) if (Ty->isFunctionType())
return ExprError(Diag(TyBeginLoc, diag::err_init_for_function_type) return ExprError(Diag(TyBeginLoc, diag::err_init_for_function_type)
<< Ty << FullRange); << Ty << FullRange);