File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3584,22 +3584,23 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
35843584
35853585 // Remove redundant parentheses
35863586 simplifyRedundantParentheses ();
3587- for (Token *tok = list.front (); tok; tok = tok->next ())
3588- while (TemplateSimplifier::simplifyNumericCalculations (tok))
3589- ;
35903587
3591- // Handle templates..
3592- simplifyTemplates ();
3588+ if (!isC ()) {
3589+ // TODO: Only simplify template parameters
3590+ for (Token *tok = list.front (); tok; tok = tok->next ())
3591+ while (TemplateSimplifier::simplifyNumericCalculations (tok))
3592+ ;
35933593
3594- // The simplifyTemplates have inner loops
3595- if (_settings->terminated ())
3596- return false ;
3594+ // Handle templates..
3595+ simplifyTemplates ();
35973596
3598- // Simplify templates.. sometimes the "simplifyTemplates" fail and
3599- // then unsimplified function calls etc remain. These have the
3600- // "wrong" syntax. So this function will just fix so that the
3601- // syntax is corrected.
3602- if (!isC ()) {
3597+ // The simplifyTemplates have inner loops
3598+ if (_settings->terminated ())
3599+ return false ;
3600+
3601+ // sometimes the "simplifyTemplates" fail and then unsimplified
3602+ // function calls etc remain. These have the "wrong" syntax. So
3603+ // this function will just fix so that the syntax is corrected.
36033604 validate (); // #6847 - invalid code
36043605 TemplateSimplifier::cleanupAfterSimplify (list.front ());
36053606 }
You can’t perform that action at this time.
0 commit comments