Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cxx-abi-dev] Mangling late-specified return types/decltype


  • To: Jason Merrill <jason@xxxxxxxxxx>
  • Subject: Re: [cxx-abi-dev] Mangling late-specified return types/decltype
  • From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
  • Date: Thu, 30 Oct 2008 16:40:09 -0400

Jason Merrill wrote:

> If we are mangling decltype(expr with describable type), we just replace
> that with the type.  Otherwise, within decltype/sizeof/alignof, if a
> subexpression has describable type we replace it in the mangling with a
> type stub: sT <type> if decltype((subexpression)) is a reference type,
> or sR <type> if it is not.

Is the type of the expression sufficiently canonical?  For example, I
worry that one compiler will decide the expression has type "typename
A<T>::B" while another decides that the type is "int" because it
resolves a dependent type, or "typename A<T>::C" (because there's a
typedef equating "B" and "C"), or some such.  Or even things like
determining that the type is "void ()(T[3])" vs. "void ()(T*)".

In other words, the advantage to a syntactic mangling based on the form
of the decltype expression is that it's more obvious what the right
answer is, whereas the a semantic mangling based on your definition of
describable type might not be as well-defined.

I've not been keeping up sufficiently with the latest C++ standards
development to know how fair such a worry might be, so I apologize in
advance if this is obviously moot.

-- 
Mark Mitchell
CodeSourcery
mark@xxxxxxxxxxxxxxxx
(650) 331-3385 x713