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 for c++/91230 - wrong error with __PRETTY_FUNCTION__ and generic lambda


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


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