Rewording the "static_assert" to static assertion
authorMuhammad Usman Shahid <codesbyusman@gmail.com>
Thu, 21 Jul 2022 13:32:54 +0000 (06:32 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 21 Jul 2022 13:34:14 +0000 (06:34 -0700)
commit6542cb55a3eb115b1c3592514590a19987ffc498
tree3d63386ea2363dcdf473c8453c096c910bbb2885
parentbc33c2fa0c2a68a0431df0d825cc6df99a1883db
Rewording the "static_assert" to static assertion

This patch is basically the rewording of the static assert statement's
output(error) on screen after failing. Failing a _Static_assert in C
should not report that static_assert failed. It’d probably be better to
reword the diagnostic to be more like GCC and say “static assertion”
failed in both C and C++.

consider a c file having code

_Static_assert(0, "oh no!");

In clang the output is like:

<source>:1:1: error: static_assert failed: oh no!
_Static_assert(0, "oh no!");
^              ~
1 error generated.
Compiler returned: 1

Thus here the "static_assert" is not much good, it will be better to
reword it to the "static assertion failed" to more generic. as the gcc
prints as:

<source>:1:1: error: static assertion failed: "oh no!"
    1 | _Static_assert(0, "oh no!");
          | ^~~~~~~~~~~~~~
          Compiler returned: 1

The above can also be seen here. This patch is about rewording
the static_assert to static assertion.

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