Revert fix for #6181, that caused #6354 and #6414.

This commit is contained in:
Simon Martin 2015-02-14 12:29:05 +01:00
parent 22424ba54a
commit c4c46be972
2 changed files with 26 additions and 8 deletions

View File

@ -1320,8 +1320,6 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
++indentlevel5; ++indentlevel5;
else if (indentlevel5 > 0 && Token::Match(tok5, "> [,>]")) else if (indentlevel5 > 0 && Token::Match(tok5, "> [,>]"))
--indentlevel5; --indentlevel5;
else if (indentlevel5 > 0 && tok5->str() == ">>")
indentlevel5 -= 2;
else if (indentlevel5 == 0) { else if (indentlevel5 == 0) {
if (tok5->str() != ",") { if (tok5->str() != ",") {
if (!typetok || if (!typetok ||

View File

@ -827,7 +827,7 @@ private:
"void z() {\n" "void z() {\n"
" vector<int> VI;\n" " vector<int> VI;\n"
"}\n"; "}\n";
tokenizeAndStringify(code, true); ASSERT_THROW(tokenizeAndStringify(code, true), InternalError);
} }
void tokenize34() { // #6121 void tokenize34() { // #6121
@ -5222,11 +5222,31 @@ private:
tokenizeAndStringify(code)); tokenizeAndStringify(code));
} }
void cpp0xtemplate4() { // #6181 void cpp0xtemplate4() { // #6181, #6354, #6414
tokenizeAndStringify("class A; " ASSERT_THROW(tokenizeAndStringify("class A; "
"template <class T> class Disposer; " "template <class T> class Disposer; "
"template <typename T, class D = Disposer<T>> class Shim {}; " "template <typename T, class D = Disposer<T>> class Shim {}; "
"class B : public Shim<A> {};"); "class B : public Shim<A> {};"), InternalError);
tokenizeAndStringify("template <class ELFT> class ELFObjectImage {}; "
"ObjectImage *createObjectImage() { "
" return new ELFObjectImage<ELFType<little>>(Obj); "
"} "
"void resolveX86_64Relocation() { "
" reinterpret_cast<int>(0); "
"}");
tokenizeAndStringify("template<typename value_type, typename function_type> "
"value_type Base(const value_type x, const value_type dx, function_type func, int type_deriv) { "
" return 0.0; "
"}; "
"namespace { "
" template<class DC> class C { "
" void Fun(int G, const double x); "
" }; "
" template<class DC> void C<DC>::Fun(int G, const double x) {"
" Base<double, CDFFunctor<DC>>(2, 2, f, 0); "
" }; "
" template<class DC> class C2 {}; "
"}");
} }
std::string arraySize_(const std::string &code) { std::string arraySize_(const std::string &code) {