Skip to content

Commit

Permalink
[clang-tools-extra] the message in a static_assert is not always a st…
Browse files Browse the repository at this point in the history
…ring literal

Fixes build failure introduce by 47ccfd7.
  • Loading branch information
cor3ntin committed Jul 20, 2023
1 parent 9324e1b commit 528447f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ void UnaryStaticAssertCheck::registerMatchers(MatchFinder *Finder) {
void UnaryStaticAssertCheck::check(const MatchFinder::MatchResult &Result) {
const auto *MatchedDecl =
Result.Nodes.getNodeAs<StaticAssertDecl>("static_assert");
const StringLiteral *AssertMessage = MatchedDecl->getMessage();
const auto *AssertMessage =
dyn_cast_if_present<StringLiteral>(MatchedDecl->getMessage());

SourceLocation Loc = MatchedDecl->getLocation();

Expand Down

0 comments on commit 528447f

Please sign in to comment.