forked from OSchip/llvm-project
More correct handling of error cases C++ name parser
Now incorrect type argument that looks like T<A><B> doesn't cause an assert, but just a parsing error. Bug: 36224 Differential Revision: https://reviews.llvm.org/D42939 llvm-svn: 324380
This commit is contained in:
parent
f951fc399f
commit
9e916e5e0e
|
@ -242,8 +242,7 @@ bool CPlusPlusNameParser::ConsumeTemplateArgs() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(template_counter >= 0);
|
if (template_counter != 0) {
|
||||||
if (template_counter > 0) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
start_position.Remove();
|
start_position.Remove();
|
||||||
|
|
|
@ -160,4 +160,6 @@ TEST(CPlusPlusLanguage, ExtractContextAndIdentifier) {
|
||||||
"selector:otherField:", context, basename));
|
"selector:otherField:", context, basename));
|
||||||
EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
|
EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
|
||||||
"abc::", context, basename));
|
"abc::", context, basename));
|
||||||
|
EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
|
||||||
|
"f<A<B><C>>", context, basename));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue