This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Tweak misc-static-assert fix in c++17
ClosedPublic

Authored by njames93 on Feb 23 2021, 11:37 AM.

Details

Summary

If C++17 mode is enabled and the assert doesn't have a string literal, we can emit a static assert with no message in favour of one with an empty message.

Diff Detail

Event Timeline

njames93 created this revision.Feb 23 2021, 11:37 AM
njames93 requested review of this revision.Feb 23 2021, 11:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2021, 11:37 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
njames93 added inline comments.Feb 23 2021, 11:39 AM
clang-tools-extra/test/clang-tidy/checkers/misc-static-assert.cpp
41–43

This seems to be a shortfall in check_clang_tidy.py. It will pass CHECK-MESSAGES-CXX(11|17) as a prefix to file check even though it knows it wasn't in the source file. This causes filecheck to fail.
Duplicating the CHECK-MESSAGE for each is just a work around.

This revision is now accepted and ready to land.Mar 1 2021, 10:41 AM
This revision was automatically updated to reflect the committed changes.