Require use of digraphs in macro redefinitions to match the original.

This is part of the general requirement that macro redefinitions be "identical" as defined in the standard.

This affects code like:

#define x [
#define x <:
This commit is contained in:
Stephen Heumann 2022-04-05 19:47:22 -05:00
parent a1d57c4db3
commit 21f266c5df
1 changed files with 6 additions and 1 deletions

View File

@ -2650,7 +2650,12 @@ var
goto 3;
if tk1^.token.class = tk2^.token.class then
case tk1^.token.class of
reservedWord, reservedSymbol: ;
reservedWord: ;
reservedSymbol:
if tk1^.token.isDigraph <> tk2^.token.isDigraph then
if tk1^.token.kind in [lbrackch,rbrackch,lbracech,
rbracech,poundch,poundpoundop] then
goto 3;
identifier:
if tk1^.token.name^ <> tk2^.token.name^ then
goto 3;