parent
1bc0317719
commit
961ecfbe33
|
@ -4050,7 +4050,7 @@ void Tokenizer::setVarIdPass1()
|
||||||
const Token *end = tok->findClosingBracket();
|
const Token *end = tok->findClosingBracket();
|
||||||
while (tok != end) {
|
while (tok != end) {
|
||||||
if (tok->isName() && !(Token::simpleMatch(tok->next(), "<") &&
|
if (tok->isName() && !(Token::simpleMatch(tok->next(), "<") &&
|
||||||
Token::Match(tok->tokAt(-2), "std :: %name%"))) {
|
Token::Match(tok->tokAt(-1), ":: %name%"))) {
|
||||||
const std::map<std::string, int>::const_iterator it = variableMap.find(tok->str());
|
const std::map<std::string, int>::const_iterator it = variableMap.find(tok->str());
|
||||||
if (it != variableMap.end())
|
if (it != variableMap.end())
|
||||||
tok->varId(it->second);
|
tok->varId(it->second);
|
||||||
|
|
|
@ -2339,13 +2339,21 @@ private:
|
||||||
tokenize("VertexArrayIterator<float[2]> attrPos = m_AttributePos.GetIterator<float[2]>();"));
|
tokenize("VertexArrayIterator<float[2]> attrPos = m_AttributePos.GetIterator<float[2]>();"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void varid_templateParameter() { // #7046 set varid for "X": std::array<int,X> Y;
|
void varid_templateParameter() {
|
||||||
const char code[] = "const int X = 0;\n"
|
{
|
||||||
"std::array<int,X> Y;\n";
|
const char code[] = "const int X = 0;\n" // #7046 set varid for "X": std::array<int,X> Y;
|
||||||
|
"std::array<int,X> Y;\n";
|
||||||
|
|
||||||
ASSERT_EQUALS("1: const int X@1 = 0 ;\n"
|
ASSERT_EQUALS("1: const int X@1 = 0 ;\n"
|
||||||
"2: std :: array < int , X@1 > Y@2 ;\n",
|
"2: std :: array < int , X@1 > Y@2 ;\n",
|
||||||
tokenize(code));
|
tokenize(code));
|
||||||
|
}
|
||||||
|
{
|
||||||
|
const char code[] = "std::optional<N::Foo<A>> Foo;\n"; // #11003
|
||||||
|
|
||||||
|
ASSERT_EQUALS("1: std :: optional < N :: Foo < A > > Foo@1 ;\n",
|
||||||
|
tokenize(code));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void varid_templateUsing() { // #5781 #7273
|
void varid_templateUsing() { // #5781 #7273
|
||||||
|
|
Loading…
Reference in New Issue