public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57041] [4.7/4.8/4.9 Regression] ICE in lookup_field_1, at cp/search.c:376 (with dot-prefixed structure initialisation)
Date: Tue, 23 Apr 2013 10:06:00 -0000	[thread overview]
Message-ID: <bug-57041-4-HK87zCvzGa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57041-4@http.gcc.gnu.org/bugzilla/>


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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-04-23 10:06:37 UTC ---
lookup_field_1 instead of IDENTIFIER_NODE gets the error_mark_node, and the
following assert chokes on it:
  gcc_assert (identifier_p (name));

It seems that if we just return NULL_TREE in that case, everything is fine.

--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -381,7 +381,7 @@ lookup_field_1 (tree type, tree name, bool want_type)
 {
   tree field;

-  gcc_assert (identifier_p (name));
+  gcc_assert (identifier_p (name) || name == error_mark_node);

   if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
       || TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM


  parent reply	other threads:[~2013-04-23 10:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23  8:21 [Bug c++/57041] New: " slayoo at staszic dot waw.pl
2013-04-23  8:56 ` [Bug c++/57041] " mpolacek at gcc dot gnu.org
2013-04-23  9:41 ` [Bug c++/57041] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
2013-04-23 10:06 ` mpolacek at gcc dot gnu.org [this message]
2013-04-24  9:28 ` [Bug c++/57041] [4.7/4.8/4.9 " paolo.carlini at oracle dot com
2013-05-13 19:35 ` jason at gcc dot gnu.org
2013-05-14 14:55 ` jason at gcc dot gnu.org
2013-05-14 15:53 ` paolo.carlini at oracle dot com

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=bug-57041-4-HK87zCvzGa@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).