aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/warn/Wunused-function1.C12
-rw-r--r--gcc/toplev.c1
3 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b1788a0..86450b0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
index 0000000..86b319a
--- /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 306d008..b1ccc18 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)