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]

Re: [C++ PATCH]: Fix 11525


On Fri, 2003-08-01 at 02:10, Nathan Sidwell wrote:
> Hi,
> I've installed the attached obvious patch for 11525. We were saying that
> a dependent expression was non-constant far too early. Interestingly
> this bug only shows up for function scope static consts, not class
> scope static consts -- the linkage on the former is internal, but the
> latter external, so the latter is a valid object for a
> non-type template arg.
> 
> - 		/* Since this name was dependent, the expression isn't
> - 		   constant -- yet.  No error is issued because it
> - 		   might be constant when things are instantiated.  */
> - 		if (parser->constant_expression_p)
> - 		  parser->non_constant_expression_p = true;

I wonder why I wrote that code.  I must have had a reason, but that
comment doesn't explain it.  Maybe it predated the non-dependent
expression stuff and was necessary in that not-quite-parallel universe.

Anyhow, if your change passes tests it certainly makes sense.

Thanks,

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


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