public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin v. Loewis" <loewis@informatik.hu-berlin.de>
To: egcs@cygnus.com
Cc: brendan@cygnus.com
Subject: Re: bug w/ your May 8 change
Date: Tue, 12 May 1998 10:17:00 -0000	[thread overview]
Message-ID: <199805121716.TAA08313@punica> (raw)
In-Reply-To: <9597.894929289@lisa.cygnus.com>

> Hi!  Your change to IDENTIFIER_TYPE_VALUE introduced an interesting
> bug.  If you try to compile the file below (after uudecoding it),
> you'll see it go into an infinite loop between lookup_name_real and
> identifier_type_value.

Brendan,

Thanks for your test case. A fix and two regression tests are included
below.

Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.103
diff -c -p -r1.103 decl.c
*** decl.c	1998/05/09 18:10:26	1.103
--- decl.c	1998/05/12 17:09:36
*************** lookup_name_real (name, prefer_type, non
*** 4812,4818 ****
    locval = classval = NULL_TREE;
  
    if (!current_binding_level->namespace_p
!       && IDENTIFIER_LOCAL_VALUE (name))
      locval = IDENTIFIER_LOCAL_VALUE (name);
  
    /* In C++ class fields are between local and global scope,
--- 4812,4820 ----
    locval = classval = NULL_TREE;
  
    if (!current_binding_level->namespace_p
!       && IDENTIFIER_LOCAL_VALUE (name)
!       && (prefer_type <= 0
!           || TREE_CODE (IDENTIFIER_LOCAL_VALUE (name)) == TYPE_DECL))
      locval = IDENTIFIER_LOCAL_VALUE (name);
  
    /* In C++ class fields are between local and global scope,
Tue May 12 19:11:13 1998  Martin v. Loewis  <loewis@informatik.hu-berlin.de>

	* decl.c (lookup_name_real): When requesting a type, don't return
	a local non-type.


---------------------------------------------------------------------
//Build don't link:
//A local non-type name is ignored when searching an elaborated type name
struct S{};

void f()
{
  struct S S;
  struct S s1;
}
---------------------------------------------------------------------
//Build don't link:
//A local typedef works as a type
struct S{};

void f()
{
  typedef struct S R;
  R s1;
}

           reply	other threads:[~1998-05-12 10:17 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <9597.894929289@lisa.cygnus.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=199805121716.TAA08313@punica \
    --to=loewis@informatik.hu-berlin.de \
    --cc=brendan@cygnus.com \
    --cc=egcs@cygnus.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).