[Bug c++/15045] New: always_inline fails with template and constructor
joerg dot richter at pdv-fs dot de
gcc-bugzilla@gcc.gnu.org
Wed Apr 21 15:28:00 GMT 2004
/// main.cc
template<class T> struct Foo
{
Foo() __attribute__((always_inline));
};
template<class T> Foo<T>::Foo() {}
void bar()
{
Foo<int> foo;
}
//////
$ g++ -v
Reading specs from .../gcc/3.4.0/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Configured with: ../gcc-3.4.0/configure --prefix=.../gcc/3.4.0
Thread model: posix
gcc version 3.4.0
$ g++ -c -o main.o main.cc
main.cc: In function `void bar()':
main.cc:6: sorry, unimplemented: inlining failed in call to 'Foo<T>::Foo()
[with T = int]': function body not available
main.cc:10: sorry, unimplemented: called from here
The error message points at the function body (line 6) and says that it is not
available.
GCC 3.3.3 is able to inline the call.
--
Summary: always_inline fails with template and constructor
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: joerg dot richter at pdv-fs dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15045
More information about the Gcc-bugs
mailing list