 |
|
|
|
Actions
|
|
[ Date Prev][ Date Next][ Thread Prev][ Thread Next][ Date Index][ Thread Index]
Re: [cxx-abi-dev] Mangling late-specified return types/decltype
- To: "cxx-abi-dev@xxxxxxxxxxxxxxxx" <cxx-abi-dev@xxxxxxxxxxxxxxxx>
- Subject: Re: [cxx-abi-dev] Mangling late-specified return types/decltype
- From: Jason Merrill <jason@xxxxxxxxxx>
- Date: Fri, 26 Sep 2008 18:05:45 -0400
Jason Merrill wrote:
More generally, within decltype/sizeof/alignof we aren't interested in
the value of a type, only the type itself, so there's a lot of
information in the expression which is irrelevant. Within decltype,
*(T*)0 and t are equivalent: both are T lvalues. T(42) and T() and
T(a,b,0932) are also equivalent: all are T rvalues.
In all these cases, it seems like we could replace these expressions
with "lvalue placeholder" (sT) or "rvalue placeholder", and simplify
decltype (T lvalue placeholder) to T so we don't have to mangle as much
random expression gunk.
Otherwise we still need to establish a mangling for T(more,than,one,arg).
Now that the C++ meeting is over, did people have reactions to this? We
would probably want to define exactly what expression forms get reduced
like this to avoid incompatibilities.
Simplifications within sizeof/alignof/decltype:
lvalue forms:
var
exp.member (where type of exp is not dependent)
exp->member (ditto *exp and exp doesn't overload op->)
*exp (where type of exp is known to be pointer to something)
rvalue forms:
T(args)
literals
rvalue.member
Should decltype(non-type-dependent expr) just get resolved to its type?
Do we want to handle anything else specially? And/or leave member
access out and mangle them using the normal rules?
Jason
|
|