On Thu, Aug 01, 2019 at 09:20:19PM -0400, Jason Merrill wrote:
> On 8/1/19 5:53 PM, Marek Polacek wrote:
> > > Hmm, when would value_expr not be error_mark_node for __PRETTY_FUNCTION__
> > > in
> > > a template?
> >
> > E.g.
> >
> > template<typename T>
> > struct S {
> > T *t{__PRETTY_FUNCTION__};
> > };
> >
> > S<const char> s;
> >
> > here cp_make_fname_decl is called in a template, but in_template_function()
> > is
> > false, so we create a decl whose DECL_VALUE_EXPR is "top level".
>
> Ah, sure. The patch is OK, but you might mention that in the comment.
I've added a comment and committed. Thanks.
Marek