[all-commits] [llvm/llvm-project] 76476e: Rewording "static_assert" diagnostics

Muhammad Usman Shahid via All-commits all-commits at lists.llvm.org
Mon Jul 25 04:24:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76476efd68951907a94def92b2bb6ba6e32ca5b4
      https://github.com/llvm/llvm-project/commit/76476efd68951907a94def92b2bb6ba6e32ca5b4
  Author: Muhammad Usman Shahid <codesbyusman at gmail.com>
  Date:   2022-07-25 (Mon, 25 Jul 2022)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticParseKinds.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Parse/Parser.h
    M clang/lib/Parse/ParseDeclCXX.cpp
    M clang/lib/Parse/Parser.cpp
    M clang/test/C/drs/dr0xx.c
    M clang/test/CXX/dcl.dcl/p4-0x.cpp
    M clang/test/CXX/drs/dr19xx.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.id/p3.cpp
    M clang/test/CXX/expr/expr.prim/expr.prim.req/nested-requirement.cpp
    M clang/test/CXX/temp/temp.constr/temp.constr.constr/partial-specializations.cpp
    M clang/test/PCH/cxx-static_assert.cpp
    M clang/test/PCH/cxx-templates.cpp
    M clang/test/Parser/objc-static-assert.m
    M clang/test/Parser/objc-static-assert.mm
    M clang/test/Sema/builtin-align.c
    M clang/test/Sema/sizeless-1.c
    M clang/test/Sema/static-assert.c
    M clang/test/SemaCXX/access-base-class.cpp
    M clang/test/SemaCXX/alias-template.cpp
    M clang/test/SemaCXX/builtin-is-constant-evaluated.cpp
    M clang/test/SemaCXX/builtin-std-move.cpp
    M clang/test/SemaCXX/builtins.cpp
    M clang/test/SemaCXX/complex-folding.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/constexpr-builtin-bit-cast.cpp
    M clang/test/SemaCXX/constexpr-function-recovery-crash.cpp
    M clang/test/SemaCXX/coroutines-exp-namespace.cpp
    M clang/test/SemaCXX/coroutines.cpp
    M clang/test/SemaCXX/cxx2a-template-lambdas.cpp
    M clang/test/SemaCXX/cxx98-compat.cpp
    M clang/test/SemaCXX/delete-and-function-templates.cpp
    M clang/test/SemaCXX/int-ptr-cast-SFINAE.cpp
    M clang/test/SemaCXX/recovery-expr-type.cpp
    M clang/test/SemaCXX/sizeless-1.cpp
    M clang/test/SemaCXX/static-assert-cxx17.cpp
    M clang/test/SemaCXX/static-assert.cpp
    M clang/test/SemaCXX/using-decl-templates.cpp
    M clang/test/SemaCXX/weak-init.cpp
    M clang/test/SemaTemplate/instantiate-var-template.cpp
    M clang/test/SemaTemplate/pr52909.cpp
    M clang/test/SemaTemplate/pr52970.cpp
    M clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp
    M libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add.verify.cpp
    M libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_add_explicit.verify.cpp
    M libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub.verify.cpp
    M libcxx/test/libcxx/atomics/atomics.types.operations/atomics.types.operations.req/atomic_fetch_sub_explicit.verify.cpp
    M libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
    M libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
    M libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
    M libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
    M libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
    M libcxx/test/libcxx/iterators/predef.iterators/reverse.iterators/bad_template_argument.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bernoulli/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.geo/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.negbin/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.poisson/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.int/bad_engine.verify.cpp
    M libcxx/test/libcxx/numerics/rand/rand.dis/rand.dist.uni/rand.dist.uni.real/bad_engine.verify.cpp
    M libcxx/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
    M libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
    M libcxx/test/libcxx/utilities/variant/variant.variant/variant.helper/variant_alternative.fail.cpp
    M libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.fail.cpp
    M libcxx/test/std/containers/associative/map/map.cons/deduct.fail.cpp
    M libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.fail.cpp
    M libcxx/test/std/containers/sequences/array/array.fill/fill.fail.cpp
    M libcxx/test/std/containers/sequences/array/array.swap/swap.fail.cpp
    M libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
    M libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
    M libcxx/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
    M libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.types.fail.cpp
    M libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
    M libcxx/test/std/numerics/numbers/illformed.verify.cpp
    M libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/params.fail.cpp
    M libcxx/test/std/strings/basic.string/char.bad.verify.cpp
    M libcxx/test/std/strings/string.view/char.bad.fail.cpp
    M libcxx/test/std/time/time.hms/hhmmss.fail.cpp
    M libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_request_invalid_value_category.fail.cpp
    M libcxx/test/std/utilities/any/any.nonmembers/any.cast/const_correctness.verify.cpp
    M libcxx/test/std/utilities/any/any.nonmembers/any.cast/not_copy_constructible.verify.cpp
    M libcxx/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
    M libcxx/test/std/utilities/format/format.formatter/format.parse.ctx/check_arg_id.verify.cpp
    M libcxx/test/std/utilities/function.objects/func.bind_front/bind_front.verify.cpp
    M libcxx/test/std/utilities/intseq/intseq.make/make_integer_seq.fail.cpp
    M libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.constexpr.size.verify.cpp
    M libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
    M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/ctor.fail.cpp
    M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/deduct.fail.cpp
    M libcxx/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
    M libcxx/test/std/utilities/optional/optional.object/optional_requires_destructible_object.fail.cpp
    M libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
    M libcxx/test/std/utilities/utility/forward/forward.fail.cpp
    M libcxx/test/std/utilities/variant/variant.relops/relops_bool_conv.fail.cpp
    M libcxx/test/std/utilities/variant/variant.variant/variant_array.fail.cpp
    M libcxx/test/std/utilities/variant/variant.variant/variant_empty.fail.cpp
    M libcxx/test/std/utilities/variant/variant.variant/variant_reference.fail.cpp
    M libcxx/test/std/utilities/variant/variant.variant/variant_void.fail.cpp

  Log Message:
  -----------
  Rewording "static_assert" diagnostics

This patch rewords the static assert diagnostic output. Failing a
_Static_assert in C should not report that static_assert failed. This
changes the wording to be more like GCC and uses "static assertion"
when possible instead of hard coding the name. This also changes some
instances of 'static_assert' to instead be based on the token in the
source code.

Differential Revision: https://reviews.llvm.org/D129048




More information about the All-commits mailing list