public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++, concepts] Two slightly obscure pt.c functions?
@ 2017-04-26 10:33 Paolo Carlini
  2017-04-27 18:02 ` [C++ Patch] Remove is_auto_or_concept, etc (Was: Re: [C++, concepts] Two slightly obscure pt.c functions?) Paolo Carlini
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Carlini @ 2017-04-26 10:33 UTC (permalink / raw)
  To: gcc; +Cc: Jason Merrill, Adam Butcher

Hi,

in 2013 (2013-09-16) Adam added two slightly obscure functions and I 
can't find much around in terms of rationale, etc:

/* Returns true iff TYPE is a TEMPLATE_TYPE_PARM representing 'auto',
    'decltype(auto)' or a concept.  */

bool
is_auto_or_concept (const_tree type)
{
   return is_auto (type); // or concept
}

/* Returns the TEMPLATE_TYPE_PARM in TYPE representing a generic type 
(`auto' or
    a concept identifier) iff TYPE contains a use of a generic type.  
Returns
    NULL_TREE otherwise.  */

tree
type_uses_auto_or_concept (tree type)
{
   return find_type_usage (type, is_auto_or_concept);
}

The latter seems completely unused (it's meant for debugging purposes?); 
the former evidently simply forwards to is_auto, and we end up in the 
front-end with uses of both, which in fact are equivalent, which seems 
weird: IMHO, if they are actually equivalent in our implementation we 
should clearly explain that in the comment and have only one. Or what?

Thanks for any feedback,

Paolo.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-05-16 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 10:33 [C++, concepts] Two slightly obscure pt.c functions? Paolo Carlini
2017-04-27 18:02 ` [C++ Patch] Remove is_auto_or_concept, etc (Was: Re: [C++, concepts] Two slightly obscure pt.c functions?) Paolo Carlini
2017-04-28 14:03   ` Nathan Sidwell
2017-05-01 15:56   ` Jason Merrill
2017-05-16 19:36     ` [C++ Patch] Remove is_auto_or_concept, etc Adam Butcher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).