summaryrefslogtreecommitdiff
path: root/tests/typing/bad/diamond.cpp
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-10 18:45:19 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-10 18:45:19 +0100
commit2c7d3a47508e2323cd70d8f65324d8c3d01e51d0 (patch)
tree294b28c4ab8b10ff14af07a206b5cdb997a645a3 /tests/typing/bad/diamond.cpp
parentc4fca6ff8ffa7ad8e6129dd0f6fe1b72d58c950f (diff)
parenta95f51e847892fe0e358c519cc4bac42382fbbb7 (diff)
downloadLPC-Projet-master.tar.gz
LPC-Projet-master.zip
Merge branch 'master' into codegen-optHEADmaster
Conflicts: src/codegen.ml
Diffstat (limited to 'tests/typing/bad/diamond.cpp')
-rw-r--r--tests/typing/bad/diamond.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/typing/bad/diamond.cpp b/tests/typing/bad/diamond.cpp
new file mode 100644
index 0000000..fe59ceb
--- /dev/null
+++ b/tests/typing/bad/diamond.cpp
@@ -0,0 +1,33 @@
+#include <iostream>
+
+
+class A { public :
+ int a;
+};
+
+class B : public A { public :
+ int b;
+};
+
+class C : public A { public :
+ int c;
+};
+
+class D : public B, public C { public :
+ int d;
+};
+
+
+
+void f(A* ap) {std::cout << ap->a << "\n";}
+
+int main () {
+
+ D* dp = new D();
+ dp->a = 42;
+ std::cout << dp-> a << "\n";
+
+ f(dp);
+
+ return 0;
+} \ No newline at end of file