File tree Expand file tree Collapse file tree 1 file changed +24
-10
lines changed Expand file tree Collapse file tree 1 file changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -1392,20 +1392,34 @@ static void skipToMatch (const char *const pair)
1392
1392
1393
1393
if (c == begin )
1394
1394
{
1395
- ++ matchLevel ;
1396
- if (braceFormatting && getDirectiveNestLevel () != initialLevel )
1397
- {
1398
- skipToFormattedBraceMatch ();
1399
- break ;
1395
+ // watch out for '<<' in template arguments
1396
+ int x = cppGetc ();
1397
+ if (c == '<' && x == '<' ) {
1398
+ // we've found a << - do nothing
1399
+ } else {
1400
+ cppUngetc (x );
1401
+ ++ matchLevel ;
1402
+ if (braceFormatting && getDirectiveNestLevel () != initialLevel )
1403
+ {
1404
+ skipToFormattedBraceMatch ();
1405
+ break ;
1406
+ }
1400
1407
}
1401
1408
}
1402
1409
else if (c == end )
1403
1410
{
1404
- -- matchLevel ;
1405
- if (braceFormatting && getDirectiveNestLevel () != initialLevel )
1406
- {
1407
- skipToFormattedBraceMatch ();
1408
- break ;
1411
+ // watch out for '>>' in template arguments
1412
+ int x = cppGetc ();
1413
+ if (c == '>' && x == '>' ) {
1414
+ // we've found a >> in a template - skip it
1415
+ } else {
1416
+ cppUngetc (x );
1417
+ -- matchLevel ;
1418
+ if (braceFormatting && getDirectiveNestLevel () != initialLevel )
1419
+ {
1420
+ skipToFormattedBraceMatch ();
1421
+ break ;
1422
+ }
1409
1423
}
1410
1424
}
1411
1425
}
You can’t perform that action at this time.
0 commit comments