Fixed #3130 (Tokenizer: Doesn't instantiate recursive template correctly)
This commit is contained in:
parent
fa31ebf88e
commit
f116de678e
|
@ -1268,7 +1268,7 @@ bool TemplateSimplifier::simplifyTemplateInstantiations(
|
||||||
amountOftemplateInstantiations = templateInstantiations.size();
|
amountOftemplateInstantiations = templateInstantiations.size();
|
||||||
simplifyCalculations(tokenlist.front());
|
simplifyCalculations(tokenlist.front());
|
||||||
++recursiveCount;
|
++recursiveCount;
|
||||||
if (recursiveCount > 100) {
|
if (recursiveCount > 1) {
|
||||||
// bail out..
|
// bail out..
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1022,7 +1022,7 @@ private:
|
||||||
"{\n"
|
"{\n"
|
||||||
" enum {value = !type_equal<T, typename Unconst<T>::type>::value };\n"
|
" enum {value = !type_equal<T, typename Unconst<T>::type>::value };\n"
|
||||||
"};";
|
"};";
|
||||||
const char expected1[]="template < class T > struct Unconst { } ; template < class T > struct type_equal<T,T> { } ; template < class T > struct template_is_const { } ; struct type_equal<T,T> { } ; struct Unconst<constT*const> { } ; struct Unconst<constT&*const> { } ; struct Unconst<T*const*const> { } ; struct Unconst<T*const> { } ; struct Unconst<T*const> { } ; struct Unconst<T*const> { } ; struct Unconst<constT&><};template<T> { } ; struct Unconst<constT><};template<T> { } ;";
|
const char expected1[]="template < class T > struct type_equal<T,T> { } ; template < class T > struct template_is_const { } ; struct type_equal<T,T> { } ; struct Unconst<constT*const> { } ; struct Unconst<constT&*const> { } ; struct Unconst<constT&><};template<T> { } ; struct Unconst<constT><};template<T> { } ; struct Unconst<T*const> { } ; struct Unconst<constT*const> { } ; struct Unconst<constT&*const> { } ;";
|
||||||
ASSERT_EQUALS(expected1, tok(code1));
|
ASSERT_EQUALS(expected1, tok(code1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue