parent
1bc0317719
commit
961ecfbe33
|
@ -4050,7 +4050,7 @@ void Tokenizer::setVarIdPass1()
|
|||
const Token *end = tok->findClosingBracket();
|
||||
while (tok != end) {
|
||||
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());
|
||||
if (it != variableMap.end())
|
||||
tok->varId(it->second);
|
||||
|
|
|
@ -2339,14 +2339,22 @@ private:
|
|||
tokenize("VertexArrayIterator<float[2]> attrPos = m_AttributePos.GetIterator<float[2]>();"));
|
||||
}
|
||||
|
||||
void varid_templateParameter() { // #7046 set varid for "X": std::array<int,X> Y;
|
||||
const char code[] = "const int X = 0;\n"
|
||||
void varid_templateParameter() {
|
||||
{
|
||||
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"
|
||||
"2: std :: array < int , X@1 > Y@2 ;\n",
|
||||
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
|
||||
const char code[] = "template<class T> using X = Y<T,4>;\n"
|
||||
|
|
Loading…
Reference in New Issue