https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123737

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I guess we need to get rid of the CPP_EMBED in comma expression optimization
unless we are guaranteed that expression has integral type.
      /* Parse the next assignment-expression.  */
      if (cp_lexer_next_token_is (parser->lexer, CPP_EMBED))
        {
          /* Users aren't interested in milions of -Wunused-value
             warnings when using #embed inside of a comma expression,
             and one CPP_NUMBER plus CPP_COMMA before it and one
             CPP_COMMA plus CPP_NUMBER after it is guaranteed by
             the preprocessor.  Thus, parse the whole CPP_EMBED just
             as a single INTEGER_CST, the last byte in it.  */
          tree raw_data = cp_lexer_peek_token (parser->lexer)->u.value;
          location_t loc = cp_lexer_peek_token (parser->lexer)->location;
          cp_lexer_consume_token (parser->lexer);
          assignment_expression
            = *raw_data_iterator (raw_data, RAW_DATA_LENGTH (raw_data) - 1);
          assignment_expression.set_location (loc);
        }
So, if expression doesn't have integral type, we need to do lots of
build_x_compound_expr calls rather than just one for the whole CPP_EMBED.

Reply via email to