This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
(C++) Patch to lookup_name_real
- To: egcs-patches at cygnus dot com
- Subject: (C++) Patch to lookup_name_real
- From: Jason Merrill <jason at cygnus dot com>
- Date: Thu, 29 Oct 1998 21:47:20 -0800
Fixes a bogus warning on
typedef typename base::foo foo;
in the libstdc++ rewrite.
1998-10-29 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (lookup_name_real): OK, only warn if not lexing.
Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.250
diff -c -p -r1.250 decl.c
*** decl.c 1998/10/28 03:36:54 1.250
--- decl.c 1998/10/30 05:46:03
*************** lookup_name_real (name, prefer_type, non
*** 5233,5242 ****
val = locval;
! /* To avoid redundant warnings, only warn when lexing, and the
! decls are significantly different. */
subtype = TREE_TYPE (TREE_TYPE (classval));
! if (yylex
&& ! (TREE_CODE (locval) == TEMPLATE_DECL
&& CLASSTYPE_TEMPLATE_INFO (subtype)
&& CLASSTYPE_TI_TEMPLATE (subtype) == locval)
--- 5233,5242 ----
val = locval;
! /* Only warn when not lexing; we don't want to warn if they
! use this name as a declarator. */
subtype = TREE_TYPE (TREE_TYPE (classval));
! if (! yylex
&& ! (TREE_CODE (locval) == TEMPLATE_DECL
&& CLASSTYPE_TEMPLATE_INFO (subtype)
&& CLASSTYPE_TI_TEMPLATE (subtype) == locval)