* Fixed #8976 (Crash on `using mystring = std::string;`) * templateSimplifier: move test case to correct file.
This commit is contained in:
parent
03c9477028
commit
9dc5dbe1ab
|
@ -3029,9 +3029,9 @@ bool TemplateSimplifier::simplifyUsing()
|
||||||
Token::eraseTokens(usingStart, usingEnd->next());
|
Token::eraseTokens(usingStart, usingEnd->next());
|
||||||
usingStart->deleteThis();
|
usingStart->deleteThis();
|
||||||
} else {
|
} else {
|
||||||
|
// this is the only code being checked so leave ';'
|
||||||
Token::eraseTokens(usingStart, usingEnd);
|
Token::eraseTokens(usingStart, usingEnd);
|
||||||
usingStart->deleteThis();
|
usingStart->deleteThis();
|
||||||
usingEnd->deleteThis();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ private:
|
||||||
|
|
||||||
TEST_CASE(simplifyUsing8970);
|
TEST_CASE(simplifyUsing8970);
|
||||||
TEST_CASE(simplifyUsing8971);
|
TEST_CASE(simplifyUsing8971);
|
||||||
|
TEST_CASE(simplifyUsing8976);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string tok(const char code[], bool simplify = true, Settings::PlatformType type = Settings::Native, bool debugwarnings = true) {
|
std::string tok(const char code[], bool simplify = true, Settings::PlatformType type = Settings::Native, bool debugwarnings = true) {
|
||||||
|
@ -452,6 +453,14 @@ private:
|
||||||
ASSERT_EQUALS(expected, tok(code, false));
|
ASSERT_EQUALS(expected, tok(code, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void simplifyUsing8976() {
|
||||||
|
const char code[] = "using mystring = std::string;";
|
||||||
|
|
||||||
|
const char exp[] = ";";
|
||||||
|
|
||||||
|
ASSERT_EQUALS(exp, tok(code));
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
REGISTER_TEST(TestSimplifyUsing)
|
REGISTER_TEST(TestSimplifyUsing)
|
||||||
|
|
Loading…
Reference in New Issue