The following testcase fails: // { dg-do compile } struct f { inline f(void); inline void f1(void); int a; };
inline __attribute__((always_inline)) f::f(void) { a++; } inline __attribute__((always_inline)) void f::f1(void) { a++; } void g(void) { f a, b, c, d; a.f1(); } // f::f() should be inlined even at -O0 // { dg-final { scan-assembly-not "_ZN1fC1Ev" } } // Likewise for f::f1() // { dg-final { scan-assembly-not "_ZN1f2f1Ev" } } --- CUT --- _ZN1fC1Ev is being defined in the source still and not being inlined. -- Summary: always_inline does not work always with constructors Product: gcc Version: 4.5.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41536