@@ -1215,7 +1215,7 @@ bool Parser::rTempArgList(irept &args)
1215
1215
: CLASS [Identifier] {'=' type.name}
1216
1216
| CLASS Ellipsis [Identifier]
1217
1217
| type.specifier arg.declarator {'=' conditional.expr}
1218
- | template.decl2 CLASS Identifier {'=' type.name}
1218
+ | template.decl2 CLASS { Identifier {'=' type.name} }
1219
1219
*/
1220
1220
bool Parser::rTempArgDeclaration (cpp_declarationt &declaration)
1221
1221
{
@@ -1340,9 +1340,14 @@ bool Parser::rTempArgDeclaration(cpp_declarationt &declaration)
1340
1340
1341
1341
cpp_tokent tk1, tk2;
1342
1342
1343
- if (lex.get_token (tk1) != TOK_CLASS || ! is_identifier (lex. get_token (tk2)) )
1343
+ if (lex.get_token (tk1) != TOK_CLASS)
1344
1344
return false ;
1345
1345
1346
+ if (lex.LookAhead (0 ) == ' ,' )
1347
+ return true ;
1348
+
1349
+ if (!is_identifier (lex.get_token (tk2)))
1350
+ return false ;
1346
1351
// Ptree cspec=new PtreeClassSpec(new LeafReserved(tk1),
1347
1352
// Ptree::Cons(new Leaf(tk2),nil),
1348
1353
// nil);
@@ -3144,6 +3149,13 @@ bool Parser::rDeclarator(
3144
3149
if (!rDeclaratorQualifier ())
3145
3150
return false ;
3146
3151
3152
+ if (lex.LookAhead (0 )==TOK_ELLIPSIS)
3153
+ {
3154
+ cpp_tokent tk;
3155
+ lex.get_token (tk);
3156
+ d_outer.set (ID_ellipsis, true );
3157
+ }
3158
+
3147
3159
#ifdef DEBUG
3148
3160
std::cout << std::string (__indent, ' ' ) << " Parser::rDeclarator2 2\n " ;
3149
3161
#endif
@@ -4095,6 +4107,12 @@ bool Parser::rTemplateArgs(irept &template_args)
4095
4107
4096
4108
if (!rConditionalExpr (exp , true ))
4097
4109
return false ;
4110
+
4111
+ if (lex.LookAhead (0 )==TOK_ELLIPSIS)
4112
+ {
4113
+ lex.get_token (tk1);
4114
+ exp .set (ID_ellipsis, true );
4115
+ }
4098
4116
}
4099
4117
4100
4118
#ifdef DEBUG
@@ -4208,14 +4226,15 @@ bool Parser::rArgDeclList(irept &arglist)
4208
4226
4209
4227
list.get_sub ().push_back (irept (irep_idt ()));
4210
4228
list.get_sub ().back ().swap (declaration);
4211
- t=lex.LookAhead (0 );
4212
- if (t==' ,' )
4213
- lex.get_token (tk);
4214
- else if (t==TOK_ELLIPSIS)
4229
+ if (lex.LookAhead (0 )==TOK_ELLIPSIS)
4215
4230
{
4216
4231
lex.get_token (tk);
4217
4232
list.get_sub ().push_back (irept (ID_ellipsis));
4218
4233
}
4234
+
4235
+ t=lex.LookAhead (0 );
4236
+ if (t==' ,' )
4237
+ lex.get_token (tk);
4219
4238
else if (t!=' )' && t!=TOK_ELLIPSIS)
4220
4239
return false ;
4221
4240
}
0 commit comments