[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.
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
/// in a switch.
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.
if (Form == Arithmetic) {
// GCC does not enforce these rules for GNU atomics, but we do, because if
// we didn't it would be very confusing. FIXME: For whom? How so?
// GCC does not enforce these rules for GNU atomics, but we do to help catch
// trivial type errors.
auto IsAllowedValueType = [&](QualType ValType) {
if (ValType->isIntegerType())
return true;
@ -5588,8 +5588,9 @@ ExprResult Sema::BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
if (!IsC11 && !AtomTy.isTriviallyCopyableType(Context) &&
!AtomTy->isScalarType()) {
// 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
// would be very confusing. FIXME: For whom? How so?
// the GNU atomics specification but we enforce it for consistency with
// 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)
<< Ptr->getType() << Ptr->getSourceRange();
return ExprError();

View File

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