We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9324e1b commit 528447fCopy full SHA for 528447f
clang-tools-extra/clang-tidy/modernize/UnaryStaticAssertCheck.cpp
@@ -21,7 +21,8 @@ void UnaryStaticAssertCheck::registerMatchers(MatchFinder *Finder) {
21
void UnaryStaticAssertCheck::check(const MatchFinder::MatchResult &Result) {
22
const auto *MatchedDecl =
23
Result.Nodes.getNodeAs<StaticAssertDecl>("static_assert");
24
- const StringLiteral *AssertMessage = MatchedDecl->getMessage();
+ const auto *AssertMessage =
25
+ dyn_cast_if_present<StringLiteral>(MatchedDecl->getMessage());
26
27
SourceLocation Loc = MatchedDecl->getLocation();
28
0 commit comments