Commit 3f23e487 by Andrew Pinski Committed by Andrew Pinski

[PATCH] Fix PR 81721: ICE with PCH and Pragma warning and C++ operator

libcpp/ChangeLog:
2019-05-19  Andrew Pinski  <apinski@marvell.com>

        PR pch/81721
        * lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
        has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.

gcc/testsuite/ChangeLog:
2019-05-19  Andrew Pinski  <apinski@marvell.com>

        PR pch/81721
        * g++.dg/pch/operator-1.C: New testcase.
        * g++.dg/pch/operator-1.Hs: New file.

From-SVN: r271395
parent 55fd9fcd
2019-05-19 Andrew Pinski <apinski@marvell.com>
PR pch/81721
* g++.dg/pch/operator-1.C: New testcase.
* g++.dg/pch/operator-1.Hs: New file.
2019-05-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/90498
......
#include "operator-1.H"
int main(void){ major(0);} /* { dg-warning "Did not Work" } */
# define __glibc_macro_warning1(message) _Pragma (#message)
# define __glibc_macro_warning(message) \
__glibc_macro_warning1 (GCC warning message)
#define __SYSMACROS_DM1(...) __glibc_macro_warning (#__VA_ARGS__)
#define __SYSMACROS_DM(symbol) __SYSMACROS_DM1 \
(Did not Work)
# define major(dev) __SYSMACROS_DM (major) (dev+0)
2019-05-19 Andrew Pinski <apinski@marvell.com>
PR pch/81721
* lex.c (cpp_token_val_index <case SPELL_OPERATOR>): If tok->flags
has NAMED_OP set, then return CPP_TOKEN_FLD_NODE.
2019-05-14 Martin Liska <mliska@suse.cz>
PR preprocessor/90382
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment