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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|paolo at gcc dot gnu.org           |
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle 
dot com

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I think we want something along the lines (only lightly tested so far, but
appears to work as expected):

Index: parser.c
===================================================================
--- parser.c    (revision 271035)
+++ parser.c    (working copy)
@@ -28998,7 +28998,11 @@ cp_parser_sizeof_operand (cp_parser* parser, enum
   /* If the type-id production did not work out, then we must be
      looking at the unary-expression production.  */
   if (!expr)
-    expr = cp_parser_unary_expression (parser);
+    {
+      cp_parser_commit_to_tentative_parse (parser);
+      
+      expr = cp_parser_unary_expression (parser);
+    }

   /* Go back to evaluating expressions.  */
   --cp_unevaluated_operand;

Reply via email to