summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/pr11159.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/pr11159.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/pr11159.C37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/pr11159.C b/gcc/testsuite/g++.dg/warn/pr11159.C
new file mode 100644
index 000000000..ed4107a23
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pr11159.C
@@ -0,0 +1,37 @@
+// PR c++/11159 : erroneous warning in copy ctor with virtual inheritance
+// { dg-do compile }
+// { dg-options "-Wall -Wextra" }
+struct A
+{
+ A ();
+};
+
+struct B : virtual A
+{
+ B ();
+};
+
+struct C : virtual A
+{
+ C ();
+};
+
+struct D : B, C
+{
+ D (D const&){}
+};
+
+template <typename Base>
+struct E : Base
+{
+ E ();
+
+ E (E const &)
+ : Base ()
+ {
+ };
+};
+
+E<C> foo;
+E<C> bar (foo);
+