Skip to content

Commit 5dbd712

Browse files
committed
fix wrongly interpreted >> in template
1 parent f928218 commit 5dbd712

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

c.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,20 +1410,14 @@ static void skipToMatch (const char *const pair)
14101410
}
14111411
else if (c == end)
14121412
{
1413-
// watch out for '>>' in template arguments
1413+
// don't care if you find a '>>' (the important thing is closing the brackets)
14141414
int x = cppGetc ();
1415-
if(c == '>' && x == '>') {
1416-
// we've found a >> - do nothing except record the signature
1417-
if (CollectingSignature)
1418-
vStringPut(Signature, x);
1419-
} else {
1420-
cppUngetc (x);
1421-
--matchLevel;
1422-
if (braceFormatting && getDirectiveNestLevel () != initialLevel)
1423-
{
1424-
skipToFormattedBraceMatch ();
1425-
break;
1426-
}
1415+
cppUngetc (x);
1416+
--matchLevel;
1417+
if (braceFormatting && getDirectiveNestLevel () != initialLevel)
1418+
{
1419+
skipToFormattedBraceMatch ();
1420+
break;
14271421
}
14281422
}
14291423
/* early out if matching "<>" and we encounter a ";" or "{" to mitigate

0 commit comments

Comments
 (0)