public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [C PATCH] Fix parsing when using declarations in for loops and typedefs (PR c/67784)
Date: Thu, 12 Nov 2015 20:59:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.10.1511122058300.18426@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20151112195719.GG3185@redhat.com>

On Thu, 12 Nov 2015, Marek Polacek wrote:

> As explained in the PR, the issue here was that we were treating a TYPENAME
> wrongly as an ID.  That happened because we were using information from the
> wrong scope when parsing a token after an else clause.  I.e. in fn1 in the
> attached testcase we need to examine the token after "if (1);" to see if it's
> the "else" keyword, but when it's not, we use the scope of the for loop when
> classifying the token, so we wrongly see "T" as a identifier of a variable.
> Fixed by examining the token again and reclassifying it.
> 
> Moreover, we were ICEing in a similar scenario, treating ID as a TYPENAME, as
> demonstrated in pr67784-2.c.  The fix is analogical.
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk?

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

      reply	other threads:[~2015-11-12 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 19:57 Marek Polacek
2015-11-12 20:59 ` Joseph Myers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.10.1511122058300.18426@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).