Bug 15045 - always_inline fails with template and constructor
Summary: always_inline fails with template and constructor
Status: RESOLVED DUPLICATE of bug 14950
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2004-04-21 15:21 UTC by Jörg Richter
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Richter 2004-04-21 15:21:02 UTC
/// 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 

GCC 3.3.3 is able to inline the call.
Comment 1 Andrew Pinski 2004-04-21 15:23:50 UTC
This is a dup of bug 14950, they are the same problem.

*** This bug has been marked as a duplicate of 14950 ***