[cfe-dev] clang and gcc implement __PRETTY_FUNCTION__ differently

Matthieu Monrocq matthieu.monrocq at gmail.com
Fri Apr 6 09:21:50 PDT 2012


Le 5 avril 2012 22:28, Nikola Smiljanic <popizdeh at gmail.com> a écrit :

> > This would be cleaner as:
> >
> >        if (const FunctionDecl *Pattern =
> FD->getTemplateInstantiationPattern())
> >          Decl = Pattern;
>
> I wanted to save a line of code but you're right, this is easier to
> understand. Fixed.
>
> > Any chance I could get you to add support for C++11 ref-qualifiers here?
> For example,
> >
> >        struct X {
> >                X &operator=(const X&) &;
> >        };
>
> No problem, but since I don't even know what ref-qualifiers are I'd
> like to get the current version committed first if you don't mind.
>
> > Some template parameters might be unnamed. Shouldn't we just skip those?
> (Same comment below)
>
> Never seen one of those in my life, but you learn something new every
> day. Test added, they are skipped now.
>
>
This is a typical case of forward declaration, where the names do not
matter, only the arity (for types) and actual types (for non-types) does.

    namespace std { template <typename, typename, typename, typename> class
map; }

It occurs even more frequently in friends declaration, in my experience.

In essence, the idea is similar to not naming the unused parameters of a
function.

-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120406/6ddd77b4/attachment.html>


More information about the cfe-dev mailing list