This is the mail archive of the gcc-bugs@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]

[Bug c++/13740] ICE when mangling template which uses typeof


------- Additional Comments From ian at wasabisystems dot com  2004-01-19 18:01 -------
Subject: Re:  ICE when mangling template which uses typeof

"gdr at integrable-solutions dot net" <gcc-bugzilla@gcc.gnu.org> writes:

> | For the particular case of the GNU extension typeof, it seems to me
> | that we can only see that extension in a template argument.  Any use
> 
> And in function template return type too.  No?

Yes, true.

> | To specify a single type, you can just use the existing U mangling:
> |     <type> ::= U <source-name> <type>
> | 
> | To specify a single expression as part of a <type>, we do need an
> | extension.  We can't use 'X' for this, but we could use 'Y':
> |     <type> ::= Y <expression> E
> | 
> | Or we could follow Nathan's suggestion, using 'Y':
> |     <type> ::= Y <digit1> <digit2> <sourcename> <type>... [n1] <expression>...[n2]
> 
> for things like __builtin_offsetof, that might be needed.
> 
> | There is no current mangling which works like this, though, so I think
> | it would be more in the spirit of the current ABI to do this:
> |     <type> ::= Y <sourcename> <template-arg>+ E
> 
> Yes I like its simplicity, but it would fail to support things
> __builtin_offsetof, no? 

I don't see why.  It ought to support anythning which Nathan's
suggestion would support.  For example, __builtin_offsetof(foo, bar)
might be
    Y18__builtin_offsetof3foo3barE
and __builtin_offsetof(foo<int>, bar) might be
    Y18__builtin_offsetof3fooIiE3barE

In general, this approach would let you qualify the type using
anything which can appear as a template parameter, which includes any
type or expression.  What else would you like to see here?

> | This would be described as a vendor-specified type which takes
> | arbitrary arguments.  The arguments are anything which is permitted in
> | a template expansion, which permits both types and expressions.  I
> | think that ought to be sufficiently flexible.
> 
> Agreed.  Isn't this an issue that should probably be raised on the ABI
> reflector or can we just go ahead set precedence?

I don't know.  You would have to ask somebody at CodeSourcery what
they think.

Ian


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13740


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