[all-commits] [llvm/llvm-project] 6542cb: Rewording the "static_assert" to static assertion
Muhammad Usman Shahid via All-commits
all-commits at lists.llvm.org
Thu Jul 21 06:34:30 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6542cb55a3eb115b1c3592514590a19987ffc498
https://github.com/llvm/llvm-project/commit/6542cb55a3eb115b1c3592514590a19987ffc498
Author: Muhammad Usman Shahid <codesbyusman at gmail.com>
Date: 2022-07-21 (Thu, 21 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 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
More information about the All-commits
mailing list