Handle void * conversions in FreeBSD/x86 native code to fix C++ build.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / classes.cc
index b1100a1e3a292d6aff17239e8d5cec0ea6f56fad..bdb1f8a75a969b95b12c7a4fc2e108710db13f8b 100644 (file)
@@ -1,6 +1,6 @@
 /* This testcase is part of GDB, the GNU debugger.
 
-   Copyright 1993-2014 Free Software Foundation, Inc.
+   Copyright 1993-2016 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -434,6 +434,24 @@ Foo::operator int() { return x; }
 ByAnyOtherName foo(10, 11);
 Bar bar(20, 21, 22);
 
+/* Use a typedef for the baseclass to exercise gnu-v3-abi.c:gnuv3_dynamic_class
+   recursion.  It's important that the class itself have no name to make sure
+   the typedef makes it through to the recursive call.  */
+typedef class {
+ public:
+  int x;
+  virtual int get_x () { return x; }
+} DynamicBase2;
+
+class DynamicBar : public DynamicBase2
+{
+ public:
+  DynamicBar (int i, int j) { x = i; y = j; }
+  int y;
+};
+
+DynamicBar dynbar (23, 24);
+
 class ClassWithEnum {
 public:
   enum PrivEnum { red, green, blue, yellow = 42 };
This page took 0.024189 seconds and 4 git commands to generate.