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] Handle CONSTRUCTOR in value_dependent_expression_p (PR c++/29570)


On Mon, Nov 20, 2006 at 12:33:01PM -0800, Mark Mitchell wrote:
> Jason Merrill wrote:
> > OK.
> 
> Actually, I don't think this is a good solution.
> 
> I would like to know why we're looking at the body of this CONSTRUCTOR
> at all, since such a thing is not an integral constant-expression.  (The
> comment above value_dependent_expression_p says that EXPRESSION is
> already known to be a constant expression.)  The intent is that this
> routine only be called when the parser has already identified the
> expression as a constant-expression.

This is the [dcl.init]/13 case, scalar initialized with { val }
which is equivalent to val initializer.  And, val in this case
(A<N>::i) is constant expression.
Perhaps it is enough just to check for a single elt CONSTRUCTOR
in cp_finish_decl and see if it is value_dependent_expression_p.

	Jakub


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