Fixed #1981 (false positive: syntax error on template operator <)
This commit is contained in:
parent
5c3ecc31da
commit
8b18aaff25
|
@ -1785,7 +1785,9 @@ bool Tokenizer::tokenize(std::istream &code, const char FileName[], const std::s
|
||||||
else if (tok2->str() == "<")
|
else if (tok2->str() == "<")
|
||||||
{
|
{
|
||||||
bool inclevel = false;
|
bool inclevel = false;
|
||||||
if (level == 0)
|
if (Token::simpleMatch(tok2->previous(), "operator <"))
|
||||||
|
;
|
||||||
|
else if (level == 0)
|
||||||
inclevel = true;
|
inclevel = true;
|
||||||
else if (tok2->next()->isStandardType())
|
else if (tok2->next()->isStandardType())
|
||||||
inclevel = true;
|
inclevel = true;
|
||||||
|
|
|
@ -3682,6 +3682,15 @@ private:
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ok code..
|
||||||
|
{
|
||||||
|
errout.str("");
|
||||||
|
std::istringstream istr("template<class T> operator<(T a, T b) { }\n");
|
||||||
|
Tokenizer tokenizer(0, this);
|
||||||
|
tokenizer.tokenize(istr, "test.cpp");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
}
|
||||||
|
|
||||||
// bad code.. missing ">"
|
// bad code.. missing ">"
|
||||||
{
|
{
|
||||||
errout.str("");
|
errout.str("");
|
||||||
|
|
Loading…
Reference in New Issue