On Thu, Nov 22, 2018 at 10:21:53AM +0100, Andreas Schwab wrote:
> On Nov 22 2018, Jakub Jelinek <ja...@redhat.com> wrote:
> 
> > Is that with --enable-checking=release
> 
> Yes.

Ok, reproduced myself, fixed thusly, committed to unbreak it.

cp_expr has
  operator tree () const { return m_value; }
  tree & operator* () { return m_value; }
  tree operator* () const { return m_value; }
  tree & operator-> () { return m_value; }
  tree operator-> () const { return m_value; }
so it does the right thing most of the time, like with:
TREE_CHECK (NODE, something)->something_else
even if #define TREE_CHECK(NODE) NODE
But in this case we have:
#define USERDEF_LITERAL_VALUE(NODE) \
  (((struct tree_userdef_literal *)USERDEF_LITERAL_CHECK (NODE))->value)
and so it works only if TREE_CHECK expands to something that forces the cast
to tree.

2018-11-22  Jakub Jelinek  <ja...@redhat.com>

        PR c++/87386
        * parser.c (cp_parser_operator): Use str.get_value () instead of just
        str in USERDEF_LITERAL_VALUE and USERDEF_LITERAL_SUFFIX_ID arguments.

--- gcc/cp/parser.c.jj  2018-11-21 23:40:10.999140630 +0100
+++ gcc/cp/parser.c     2018-11-22 10:19:47.384240264 +0100
@@ -15306,8 +15306,8 @@ cp_parser_operator (cp_parser* parser, l
          return error_mark_node;
        else if (TREE_CODE (str) == USERDEF_LITERAL)
          {
-           string_tree = USERDEF_LITERAL_VALUE (str);
-           id = USERDEF_LITERAL_SUFFIX_ID (str);
+           string_tree = USERDEF_LITERAL_VALUE (str.get_value ());
+           id = USERDEF_LITERAL_SUFFIX_ID (str.get_value ());
            end_loc = str.get_location ();
          }
        else


        Jakub

Reply via email to