Author: Zarko Todorovski Date: 2021-12-01T13:36:46-05:00 New Revision: 3ee685f98abfc074419371b372681b56f7fd1a37
URL: https://github.com/llvm/llvm-project/commit/3ee685f98abfc074419371b372681b56f7fd1a37 DIFF: https://github.com/llvm/llvm-project/commit/3ee685f98abfc074419371b372681b56f7fd1a37.diff LOG: [NFC][Clang] Fix some comments in clang Applying post commit comment suggestions from https://reviews.llvm.org/D114025 Added: Modified: clang/include/clang/Analysis/CFG.h clang/lib/Sema/SemaChecking.cpp clang/lib/Sema/SemaExprCXX.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Analysis/CFG.h b/clang/include/clang/Analysis/CFG.h index 3b9b22e87f35c..b8e453fcc235a 100644 --- a/clang/include/clang/Analysis/CFG.h +++ b/clang/include/clang/Analysis/CFG.h @@ -515,7 +515,7 @@ class CFGTerminator { /// of the most derived class while we're in the base class. VirtualBaseBranch, - /// Number of diff erent kinds, for validity checks. We subtract 1 so that + /// Number of diff erent 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 diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index ee06425dc654a..33e2b3b5027d4 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -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(); diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 6352525845620..d25f329f85e45 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -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); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits