This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ PATCH]: Fix 10224


Hi,
I've installed this obvious fix for a regression I recently introduced in 3.4

built & tested on i686-pc-linux-gnu

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org

2003-03-27  Nathan Sidwell  <nathan at codesourcery dot com>

	PR c++/10224
	* pt.c (lookup_template_class): Only check instantiated args if
	they do not contain template parameters.

Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.676
diff -c -3 -p -r1.676 pt.c
*** cp/pt.c	27 Mar 2003 12:19:12 -0000	1.676
--- cp/pt.c	27 Mar 2003 13:50:52 -0000
*************** lookup_template_class (d1, arglist, in_d
*** 4181,4187 ****
        arglist2 = coerce_template_parms (parmlist, arglist, template,
                                          complain, /*require_all_args=*/1);
        if (arglist2 == error_mark_node
! 	  || (!processing_template_decl
  	      && check_instantiated_args (template, arglist2, complain)))
          POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
  
--- 4181,4187 ----
        arglist2 = coerce_template_parms (parmlist, arglist, template,
                                          complain, /*require_all_args=*/1);
        if (arglist2 == error_mark_node
! 	  || (!uses_template_parms (arglist2)
  	      && check_instantiated_args (template, arglist2, complain)))
          POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
  
*************** lookup_template_class (d1, arglist, in_d
*** 4272,4278 ****
  	                           complain, /*require_all_args=*/1);
  
        if (arglist == error_mark_node
! 	  || (!processing_template_decl
  	      && check_instantiated_args (template,
  					  INNERMOST_TEMPLATE_ARGS (arglist),
  					  complain)))
--- 4272,4278 ----
  	                           complain, /*require_all_args=*/1);
  
        if (arglist == error_mark_node
! 	  || (!uses_template_parms (INNERMOST_TEMPLATE_ARGS (arglist))
  	      && check_instantiated_args (template,
  					  INNERMOST_TEMPLATE_ARGS (arglist),
  					  complain)))
// { dg-do compile }

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 27 Mar 2003 <nathan at codesourcery dot com>

// PR 10224. Rejected a valid constant argument.

template <bool B> struct X {
  struct I {};
};

template <typename T> struct Y {
  static const bool selector = true;
  typedef typename X<selector>::I helper;
};

Y<int> i;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]