PR c++/43611
* semantics.c (expand_or_defer_fn_1): Do not keep extern
template inline functions.
* g++.dg/torture/pr43611.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158218
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-04-12 Richard Guenther <rguenther@suse.de>
+
+ PR c++/43611
+ * semantics.c (expand_or_defer_fn_1): Do not keep extern
+ template inline functions.
+
2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c++/28584
this function as needed so that finish_file will make sure to
output it later. Similarly, all dllexport'd functions must
be emitted; there may be callers in other DLLs. */
- if ((flag_keep_inline_functions && DECL_DECLARED_INLINE_P (fn))
+ if ((flag_keep_inline_functions
+ && DECL_DECLARED_INLINE_P (fn)
+ && !DECL_REALLY_EXTERN (fn))
|| lookup_attribute ("dllexport", DECL_ATTRIBUTES (fn)))
mark_needed (fn);
}
+2010-04-12 Richard Guenther <rguenther@suse.de>
+
+ PR c++/43611
+ * g++.dg/torture/pr43611.C: New testcase.
+
2010-04-12 Shujing Zhao <pearly.zhao@oracle.com>
PR c/36774
--- /dev/null
+// { dg-do compile }
+// { dg-options "-fkeep-inline-functions" }
+
+template < typename >
+struct A {
+ void init (int);
+ A ()
+ {
+ this->init (0);
+ }
+};
+
+template < typename >
+struct B : A < int > {
+ A < int > a;
+ B () {}
+};
+
+extern template struct A < int >;
+extern template struct B < int >;
+
+B < int > b;