re PR bootstrap/66448 (Bootstrap fails on darwin after r224161)
authorJason Merrill <jason@redhat.com>
Tue, 9 Jun 2015 14:51:30 +0000 (10:51 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 9 Jun 2015 14:51:30 +0000 (10:51 -0400)
PR bootstrap/66448
* toplev.c (check_global_declaration): Don't warn about a clone.

From-SVN: r224285

gcc/ChangeLog
gcc/testsuite/g++.dg/warn/Wunused-function1.C [new file with mode: 0644]
gcc/toplev.c

index b1788a02759220a9022e2a14f1814b528fdd9666..86450b0d0ee7fa26fcbe14da27effffa4c142422 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-09  Jason Merrill  <jason@redhat.com>
+
+       PR bootstrap/66448
+       * toplev.c (check_global_declaration): Don't warn about a clone.
+
 2015-06-09  Marek Polacek  <polacek@redhat.com>
 
        PR tree-optimization/66299
diff --git a/gcc/testsuite/g++.dg/warn/Wunused-function1.C b/gcc/testsuite/g++.dg/warn/Wunused-function1.C
new file mode 100644 (file)
index 0000000..86b319a
--- /dev/null
@@ -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" }
+}
index 306d008a41f791d50688cc9525f470c9863b7f06..b1ccc18adf357b0ed36b63b612104bfabf60eaff 100644 (file)
@@ -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)