+2003-03-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/10047
+ * decl2.c (finish_file): Don't warn about explicitly instantiated
+ inline decls.
+
2003-03-27 Nathan Sidwell <nathan@codesourcery.com>
PR c++/10224
tree decl = VARRAY_TREE (deferred_fns, i);
if (TREE_USED (decl) && DECL_DECLARED_INLINE_P (decl)
- && !(TREE_ASM_WRITTEN (decl) || DECL_SAVED_TREE (decl)))
+ && !(TREE_ASM_WRITTEN (decl) || DECL_SAVED_TREE (decl)
+ /* An explicit instantiation can be used to specify
+ that the body is in another unit. It will have
+ already verified there was a definition. */
+ || DECL_EXPLICIT_INSTANTIATION (decl)))
{
cp_warning_at ("inline function `%D' used but never defined", decl);
/* This symbol is effectively an "extern" declaration now.
+2003-03-28 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/10047
+ * g++.dg/template/inline1.C: New test.
+
2003-03-28 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/sparc-dwarf2.c: New test.
--- /dev/null
+// { dg-do compile }
+// { dg-options "-fno-default-inline -O0" }
+// { dg-final { scan-assembler-not _ZN1X3FooIiEEvT_: } }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 27 Mar 2003 <nathan@codesourcery.com>
+
+// PR 10047. bogus warning.
+
+struct X
+{
+ template <typename T> static void Foo (T) {}
+};
+
+extern template void X::Foo<int> (int); // extern, so don't emit it
+
+int main () {
+ X::Foo (1); // ok, we've seen the defn
+}
+