stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <>
Subject RE: ABI stability of aligned_union et al
Date Fri, 27 Jun 2008 00:58:14 GMT

Martin Sebor wrote:
>Martin Sebor wrote:
>> The mangling of std::aligned_union depends on support for variadic
>> templates in that specializations of the template will be mangled
>> differently depending on whether _RWSTD_NO_VARIADIC_TEMPLATES is
>> #defined or not. It seems that it should be possible to assure
>> compatible mangling between the two,
>After thinking about it some more I no longer believe this is doable.

I don't either.

>With variadic templates the mangled aligned_union will involve only
>the names of the types the template is instantiated on. Without them
>I don't see any way to emulate this unique behavior. I.e., given
>a class template X that takes, say, 2 template arguments, I don't
>see a way to prevent the compiler from including the names of both
>template arguments in the mangled name for the specialization of
>the template on just one argument. The second argument is always
>there, even if it's not actually referenced in code.
>So it seems to me that if we provide "workarounds" for the absence
>of support for variadic templates in the compiler there will be no
>way to migrate from a compiler without the feature to one with it
>without breaking the ABI of code that uses templates like
>aligned_union or tuple.

Well, perhaps we should disable _RWSTD_EXT_CXX_0X for compilers for
which we define _RWSTD_NO_RVALUE_REFERENCES and
_RWSTD_NO_VARIADIC_TEMPLATES. Then we could remove any workarounds for
compilers that don't support these features. That reduces the amount of
workaround code that has to be created and maintained.

>> but I'm not 100% sure, and
>> if it is, that it's worth the effort. There might be other
>> templates where we may not easily be able to achieve compatibility.
>> I suppose the big question then is: should we try to fortify the
>> implementation against ABI changes caused by changes in the
>> techniques used in the implementation of C++ 0x? In the past we
>> didn't concern ourselves with this issue but since we can expect
>> compilers to only start supporting some of the new core language
>> features such as variadic templates only slowly and piecemeal,
>> a few at a time, I think it's a concern that we need to address
>> early on.
>> Thoughts?
>> Martin

View raw message