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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 43168
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43168&action=edit
gcc8-pr83918.patch

Untested fix.  The problem is that potential_constant_expression_1 assumes that
a VCE has always a non-NULL type, which used to be true, a type dependent
reinterpret_cast would be REINTERPRET_CAST_EXPR, but is no longer the case when
a VCE can be a location wrapper of a type dependent decl.

Fixed by ignoring location wrappers, they can't have different type of the
operand by definition, another possible fix would be check for non-NULL
TREE_TYPE first.

Note, not sure if the
  return (RECUR (from, TREE_CODE (t) != VIEW_CONVERT_EXPR));
line is right, shouldn't that be TREE_CODE (t) == VIEW_CONVERT_EXPR ? want_rval
: rval?  I mean, VCE can be used not just as lvalue, but also rvalue...

Reply via email to