[C++ PATCH] Handle CONSTRUCTOR in value_dependent_expression_p (PR c++/29570)

Jakub Jelinek jakub@redhat.com
Mon Nov 20 20:47:00 GMT 2006

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.


More information about the Gcc-patches mailing list