From a0e4b207defe4bb8844f86ebab30aa2ca8de25d1 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 9 Jun 2015 10:51:30 -0400 Subject: [PATCH] re PR bootstrap/66448 (Bootstrap fails on darwin after r224161) PR bootstrap/66448 * toplev.c (check_global_declaration): Don't warn about a clone. From-SVN: r224285 --- gcc/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/warn/Wunused-function1.C | 12 ++++++++++++ gcc/toplev.c | 1 + 3 files changed, 18 insertions(+) create mode 100644 gcc/testsuite/g++.dg/warn/Wunused-function1.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1788a02759..86450b0d0ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-09 Jason Merrill + + PR bootstrap/66448 + * toplev.c (check_global_declaration): Don't warn about a clone. + 2015-06-09 Marek Polacek 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 index 00000000000..86b319a68e5 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wunused-function1.C @@ -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" } +} diff --git a/gcc/toplev.c b/gcc/toplev.c index 306d008a41f..b1ccc18adf3 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -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) -- 2.30.2