mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 17:01:00 +08:00
[clang-tools-extra] the message in a static_assert is not always a string literal
Fixes build failure introduce by 47ccfd7.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user