@@ -2075,6 +2075,9 @@ bool Tokenizer::hasComplicatedSyntaxErrorsInTemplates()
20752075
20762076void Tokenizer::simplifyDefaultAndDeleteInsideClass ()
20772077{
2078+ if (isC ())
2079+ return ;
2080+
20782081 // Remove "= default|delete" inside class|struct definitions
20792082 // Todo: Remove it if it is used "externally" too.
20802083 for (Token *tok = list.front (); tok; tok = tok->next ()) {
@@ -2487,6 +2490,9 @@ void Tokenizer::simplifyLabelsCaseDefault()
24872490
24882491void Tokenizer::simplifyTemplates ()
24892492{
2493+ if (isC ())
2494+ return ;
2495+
24902496 for (Token *tok = list.front (); tok; tok = tok->next ()) {
24912497 // #2648 - simple fix for sizeof used as template parameter
24922498 // TODO: this is a bit hardcoded. make a bit more generic
@@ -6640,6 +6646,9 @@ bool Tokenizer::simplifyRedundantParenthesis()
66406646
66416647void Tokenizer::simplifyReference ()
66426648{
6649+ if (isC ())
6650+ return ;
6651+
66436652 for (Token *tok = list.front (); tok; tok = tok->next ()) {
66446653 // starting executable scope..
66456654 if (Token::Match (tok, " ) const| {" )) {
@@ -7432,6 +7441,9 @@ void Tokenizer::simplifyEnum()
74327441
74337442void Tokenizer::simplifyStd ()
74347443{
7444+ if (isC ())
7445+ return ;
7446+
74357447 std::set<std::string> f;
74367448 f.insert (" strcat" );
74377449 f.insert (" strcpy" );
@@ -7946,6 +7958,9 @@ void Tokenizer::simplifyComma()
79467958
79477959void Tokenizer::removeExceptionSpecifications ()
79487960{
7961+ if (isC ())
7962+ return ;
7963+
79497964 for (Token* tok = list.front (); tok; tok = tok->next ()) {
79507965 if (Token::Match (tok, " ) const| throw (" )) {
79517966 if (tok->next ()->str () == " const" ) {
@@ -9063,6 +9078,9 @@ void Tokenizer::deleteSymbolDatabase()
90639078
90649079void Tokenizer::simplifyOperatorName ()
90659080{
9081+ if (isC ())
9082+ return ;
9083+
90669084 for (Token *tok = list.front (); tok; tok = tok->next ()) {
90679085 if (tok->str () == " operator" ) {
90689086 // operator op
@@ -9117,6 +9135,9 @@ void Tokenizer::simplifyOperatorName()
91179135// remove unnecessary member qualification..
91189136void Tokenizer::removeUnnecessaryQualification ()
91199137{
9138+ if (isC ())
9139+ return ;
9140+
91209141 std::vector<Space> classInfo;
91219142 for (Token *tok = list.front (); tok; tok = tok->next ()) {
91229143 if (Token::Match (tok, " class|struct|namespace %type% :|{" ) &&
0 commit comments