[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#195264: libstdc++5-3.3-dev: forward template declarations in <complex> let inlining fail



Please could you check, if the always_inline attribute (gcc-snapshot
package) works for you?

Herbert Valerio Riedel writes:
> Package: libstdc++5-3.3-dev
> Version: 1:3.3-2
> Severity: minor
> 
> 
> I just noticed, that std::conj() doesn't get inlined, as one'd expect it
> to be;
> 
> it seems that a forward declaration like
> 
>   template<typename _Tp> complex<_Tp> conj(const complex<_Tp>&);
> 
> keeps
> 
>   template<typename _Tp>
>     inline complex<_Tp>
>     conj(const complex<_Tp>& __z)
>     { return complex<_Tp>(__z.real(), -__z.imag()); }
> 	        
> from honoring the 'inline' keyword at all;
> by either removing the forward declaration completely, or adding the
> inline keyword to it like:
> 
>   template<typename _Tp> inline complex<_Tp> conj(const complex<_Tp>&);
> 
> g++ happily inlines the function again...
> 
> I don't know whether this is a bug at all (after all inline'ing is
> optional... :-)... 
> 
> -- System Information:
> Debian Release: testing/unstable
> Architecture: i386
> Kernel: Linux lfdux.ifs.tuwien.ac.at 2.4.20-1-k7 #1 Sat Mar 22 15:17:52 EST 2003 i686
> Locale: LANG=C, LC_CTYPE=C
> 
> Versions of packages libstdc++5-3.3-dev depends on:
> ii  g++-3.3                       1:3.3-2    The GNU C++ compiler
> ii  gcc-3.3-base                  1:3.3-2    The GNU Compiler Collection (base 
> ii  libc6-dev                     2.3.1-17   GNU C Library: Development Librari
> ii  libstdc++5                    1:3.3-2    The GNU Standard C++ Library v3
> 
> -- no debconf information
> 
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: