This is the mail archive of the gcc@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++] Another question about demangler output


On Sun, Dec 07, 2003 at 06:22:15AM +0100, Gabriel Dos Reis wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> [...]
> 
> | > 
> | > Yes. Consider but the following case
> | > 
> | >    struct foo {
> | >      typedef int (*bar)();
> | > 
> | >      operator bar();
> | > 
> | >      template<class T>
> | >        operator typeof(T (*)());     
> | >    }; 
> | > 
> | > if you use typeof to represent int (*)() in the demangled symbol, do
> | > you offer a way to distinguish it from the template instantiation with
> | > T = int (which is a  different function)?
> | 
> | Currently, an instantiation of the latter for T = double looks like:
> |   foo::operator double (*)()<double>()
> 
> Ah, I see.  That isn't valid C++ either :-)
> (Besides the 'double (*)()' thingy that started this thread, there is
> no way to specify an explicit template argument for a conversion
> function, so the <double> annotation isn't valid either).  Fun, fun.

Right.  Is there a valid way in C++ to represent the difference between
these?

Otherwise it's yet another example of the demangler being compelled to
print out invalid C++, which is making everything quite gross.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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