diff options
Diffstat (limited to 'libcpp/lex.c')
-rw-r--r-- | libcpp/lex.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libcpp/lex.c b/libcpp/lex.c index eedfcbb..16ded6e 100644 --- a/libcpp/lex.c +++ b/libcpp/lex.c @@ -3756,7 +3756,11 @@ cpp_token_val_index (const cpp_token *tok) case SPELL_LITERAL: return CPP_TOKEN_FLD_STR; case SPELL_OPERATOR: - if (tok->type == CPP_PASTE) + /* Operands which were originally spelled as ident keep around + the node for the exact spelling. */ + if (tok->flags & NAMED_OP) + return CPP_TOKEN_FLD_NODE; + else if (tok->type == CPP_PASTE) return CPP_TOKEN_FLD_TOKEN_NO; else return CPP_TOKEN_FLD_NONE; |