+++ This bug was initially created as a clone of Bug #14132 +++ Hello, I would like to start from the final solution presented for Bug # 14132 copied below for reference: So when the old code looks like: | | int A<void>::a; | | it must be replaced by: | | template class A<void>; | template<class T> int A<T>::a; Reverse the order: (1) provide the template definition of the static data member (2) instantiate the class. In our case, this type of construct works as described for the case where the parameter for the template member definition is a class, structure or native type. For instance: The following code was building and running fine in GCC 3.3 on Power PC. pool_t memdat_t<mem_t, small>::pool; Using the technique depicted in this bug, I have converted that into the code below: template class memdat_t<mem_t, small>; template<class T, unsigned int U> pool_t memdat_t<T, U>::pool; This code builds and runs on both GCC 3.3 (PPC) and GCC 3.4 (ARM). If I now have a code that is a little bit more complicated, like the one below, things get tough. pool_t memdat_t<addr_type_t<ipv4_addr_t>, huge>::pool; pool_t memdat_t<addr_type_t<ipv6_addr_t>, huge>::pool; I need to define two static members that will be differentiated based on the address family (IPv4 or IPv6). The issue is that one of the parameters of the static template member is another template (addr_type_t<ipv4_addr_t> or addr_type_t). I have not been able to figure out a way to write this code in such a way that it works (compiles and links correctly) for both GCC 3.3 and 3.4. Thanks in Advance, rds
Not a PR.