[cxx-abi-dev] Decltype mangling and type dependency

Jason Merrill jason at redhat.com
Wed Jun 23 02:12:27 UTC 2010


On 06/22/2010 03:34 PM, David Vandevoorde wrote:
> I thought we (the C++ committee) deliberately did _not_ put access control under SFINAE?

Yes, but I think this was a mistake which adds a lot of complexity to 
libraries, as people need to hack around it with cumbersome traits.  I 
recently brought this up under "SFINAE and access control" on the core 
reflector.

>> >  template <class U> decltype (a.i) f() { } // #1
>> >  template <class U> decltype (b.i) f() { } // #2
> This (#2) declaration is invalid because it's a redeclaration of #1.  (And if they weren't they'd have distinct signatures.)

Right, either they're the same function or they have distinct 
signatures.  I was arguing that they aren't the same function, so they 
need to have distinct signatures, so we shouldn't fold decltype(a.i) to int.

But I am leery of trying to define a whole new kind of dependency to 
deal with this, so I guess I'm content to decide that these are the same 
function because a.i is not value-dependent or type-dependent--and that 
these functions wouldn't be subject to the hypothetical access-SFINAE 
because the access doesn't arise from a substitution.

Jason




More information about the cxx-abi-dev mailing list