commit 16232674086f330d05f7279681978eb683990ed5
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jun 9 10:12:47 2015 -0400
PR bootstrap/66448
* toplev.c (check_global_declaration): Don't warn about a clone.
new file mode 100644
@@ -0,0 +1,12 @@
+// PR bootstrap/66448
+// { dg-options "-Wunused-function" }
+
+struct A { A(); };
+namespace {
+ struct B: virtual A { B(); };
+ B::B() { }
+ B b;
+
+ struct C: virtual A { C(); };
+ C::C() { } // { dg-warning "defined but not used" }
+}
@@ -529,6 +529,7 @@ check_global_declaration (tree decl)
&& ! (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl)))
&& ! DECL_EXTERNAL (decl)
&& ! DECL_ARTIFICIAL (decl)
+ && ! DECL_ABSTRACT_ORIGIN (decl)
&& ! TREE_PUBLIC (decl)
/* A volatile variable might be used in some non-obvious way. */
&& ! TREE_THIS_VOLATILE (decl)