[Bug c++/34269] [4.2/4.3/4.4 regression] Incomplete __decltype/__typeof expressions accepted

jason at redhat dot com gcc-bugzilla@gcc.gnu.org
Tue Nov 11 17:47:00 GMT 2008



------- Comment #5 from jason at redhat dot com  2008-11-11 17:45 -------
Subject: Re:  [4.2/4.3/4.4 regression] Incomplete __decltype/__typeof
 expressions accepted

jakub at gcc dot gnu dot org wrote:
> Another possibility would be add support for queing error messages during
> tentative parsing and at cp_parser_commit_to_tentative_parse emit them.

This seems right to me.  It's even what the comment at the top of the 
file says we do:

      Then, while we attempt to parse the construct, the parser queues 
up
      error messages, rather than issuing them immediately, and saves 
the
      tokens it consumes.  If the construct is parsed successfully, the 

      parser "commits", i.e., it issues any queued error messages and 

      the tokens that were being preserved are permanently discarded.

The simulate_error business only works for parse errors that indicate 
that this line of parsing won't work; it doesn't work for code that 
parses fine, but violates semantic rules and therefore needs an error.

Jason


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34269



More information about the Gcc-bugs mailing list