Fixed crash in clang test suite.
This commit is contained in:
parent
3f255e7685
commit
481d800d5a
|
@ -78,6 +78,9 @@ void CheckStl::iterators()
|
||||||
if (var->typeEndToken()->str() == "auto") {
|
if (var->typeEndToken()->str() == "auto") {
|
||||||
if (Token::Match(var->typeEndToken(), "auto %name% ; %name% = %var% . %name% ( )")) {
|
if (Token::Match(var->typeEndToken(), "auto %name% ; %name% = %var% . %name% ( )")) {
|
||||||
const Token* containertok = var->typeEndToken()->tokAt(5);
|
const Token* containertok = var->typeEndToken()->tokAt(5);
|
||||||
|
if (!containertok->variable())
|
||||||
|
continue;
|
||||||
|
|
||||||
const Library::Container* container = _settings->library.detectContainer(containertok->variable()->typeStartToken());
|
const Library::Container* container = _settings->library.detectContainer(containertok->variable()->typeStartToken());
|
||||||
if (!container)
|
if (!container)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -535,6 +535,14 @@ private:
|
||||||
" auto b = x.first;\n"
|
" auto b = x.first;\n"
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("const CXXRecordDecl *CXXRecordDecl::getTemplateInstantiationPattern() const {\n"
|
||||||
|
" if (auto *TD = dyn_cast<ClassTemplateSpecializationDecl>(this)) {\n"
|
||||||
|
" auto From = TD->getInstantiatedFrom();\n"
|
||||||
|
" }\n"
|
||||||
|
" return nullptr;\n"
|
||||||
|
"}");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void STLSize() {
|
void STLSize() {
|
||||||
|
|
Loading…
Reference in New Issue