[Clang] Implement CWG2518 - static_assert(false)
authorCorentin Jabot <corentinjabot@gmail.com>
Fri, 17 Feb 2023 18:45:30 +0000 (19:45 +0100)
committerCorentin Jabot <corentinjabot@gmail.com>
Tue, 28 Feb 2023 16:21:40 +0000 (17:21 +0100)
commit00e2098bf49f0ed45b3b8c22894cd3ac9a530e0f
treee4022dc5795cf863c705af66d0d49a433c7f0c7c
parent7344f8a8442a9c3cef159445f71b4f2886ed2798
[Clang] Implement CWG2518 - static_assert(false)

This allows `static_assert(false)` to not be ill-formed
in template definitions.

This change is applied as a DR in all C++ modes.

Of notes, a couple of tests were relying of the eager nature
of static_assert

* test/SemaTemplate/instantiation-dependence.cpp
* test/SemaTemplate/instantiate-var-template.cpp

I don't know if the changes to `static_assert`
still allow that sort of tests to be expressed.

Reviewed By: #clang-language-wg, erichkeane, aaron.ballman

Differential Revision: https://reviews.llvm.org/D144285
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/CXX/drs/dr25xx.cpp
clang/test/SemaCXX/access-base-class.cpp
clang/test/SemaCXX/coroutines.cpp
clang/test/SemaCXX/static-assert.cpp
clang/test/SemaTemplate/instantiate-var-template.cpp
clang/test/SemaTemplate/instantiation-dependence.cpp
clang/www/cxx_dr_status.html