Implemented better fix for #4644
This commit is contained in:
parent
2333aa2cc7
commit
796c3e101f
|
@ -2529,7 +2529,7 @@ static bool setVarIdParseDeclaration(const Token **tok, const std::map<std::stri
|
||||||
bool hasstruct = false; // Is there a "struct" or "class"?
|
bool hasstruct = false; // Is there a "struct" or "class"?
|
||||||
while (tok2) {
|
while (tok2) {
|
||||||
if (tok2->isName()) {
|
if (tok2->isName()) {
|
||||||
if (tok2->str() == "class" || tok2->str() == "struct" || tok2->str() == "union") {
|
if (tok2->str() == "class" || tok2->str() == "struct" || tok2->str() == "union" || tok2->str() == "typename") {
|
||||||
hasstruct = true;
|
hasstruct = true;
|
||||||
typeCount = 0;
|
typeCount = 0;
|
||||||
} else if (tok2->str() == "const") {
|
} else if (tok2->str() == "const") {
|
||||||
|
@ -2712,7 +2712,7 @@ void Tokenizer::setVarId()
|
||||||
notstart.insert("return");
|
notstart.insert("return");
|
||||||
notstart.insert("sizeof");
|
notstart.insert("sizeof");
|
||||||
if (!isC()) {
|
if (!isC()) {
|
||||||
static const char *str[] = {"delete","friend","new","throw","using","virtual","explicit","typename"};
|
static const char *str[] = {"delete","friend","new","throw","using","virtual","explicit"};
|
||||||
notstart.insert(str, str+(sizeof(str)/sizeof(*str)));
|
notstart.insert(str, str+(sizeof(str)/sizeof(*str)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4287,6 +4287,9 @@ private:
|
||||||
void varid_typename() {
|
void varid_typename() {
|
||||||
ASSERT_EQUALS("\n\n##file 0\n"
|
ASSERT_EQUALS("\n\n##file 0\n"
|
||||||
"1: template < int d , typename A , typename B >\n", tokenizeDebugListing("template<int d, typename A, typename B>"));
|
"1: template < int d , typename A , typename B >\n", tokenizeDebugListing("template<int d, typename A, typename B>"));
|
||||||
|
|
||||||
|
ASSERT_EQUALS("\n\n##file 0\n"
|
||||||
|
"1: typename A a@1 ;\n", tokenizeDebugListing("typename A a;"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void varidclass1() {
|
void varidclass1() {
|
||||||
|
|
Loading…
Reference in New Issue