Re: ABI stability of aligned_union et al
Travis Vitek wrote: [...] So, I'll ask again. Should we remove the workarounds for missing variadic template support to avoid any future compatibility issues? This would essentially remove parts of c++0x until the compiler provided the necessary support to do it the right way, but I don't really see that as a bad thing. I suggest we assume variadic templates in all future C++ 0x code to make progress. I don't think we need to spend time removing the workarounds that you've already implemented. They might come in handy if we happen to decide to provide similar workarounds for other components. If not, they won;'t cause any compatibility problems because the rest of our C++ 0x implementation won't compile with a compiler that doesn't support them, and they will be also easy to remove in the future. Martin
RE: ABI stability of aligned_union et al
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. >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. So, I'll ask again. Should we remove the workarounds for missing variadic template support to avoid any future compatibility issues? This would essentially remove parts of c++0x until the compiler provided the necessary support to do it the right way, but I don't really see that as a bad thing. Travis > >> 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 >> > >
RE: ABI stability of aligned_union et al
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 >> > >
Re: ABI stability of aligned_union et al
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. 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. 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