From b2ddb8ac4d6a20329a484a6763e0662318390eef Mon Sep 17 00:00:00 2001 From: Alexander Kornienko Date: Mon, 9 Mar 2015 02:27:57 +0000 Subject: [clang-tidy] Fix assertion when a dependent expression is used in an assert. llvm-svn: 231620 --- clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp') diff --git a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp index 47d6df7..fd6c4ca 100644 --- a/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp @@ -69,7 +69,9 @@ void StaticAssertCheck::check(const MatchFinder::MatchResult &Result) { StringRef MacroName = Lexer::getImmediateMacroName(AssertExpansionLoc, SM, Opts); - if (MacroName != "assert" || !Condition->isEvaluatable(*ASTCtx)) + if (MacroName != "assert" || Condition->isValueDependent() || + Condition->isTypeDependent() || Condition->isInstantiationDependent() || + !Condition->isEvaluatable(*ASTCtx)) return; // False literal is not the result of macro expansion. -- cgit v1.1