summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr104880.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/opt/pr104880.C')
-rw-r--r--gcc/testsuite/g++.dg/opt/pr104880.C43
1 files changed, 43 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/opt/pr104880.C b/gcc/testsuite/g++.dg/opt/pr104880.C
new file mode 100644
index 00000000000..de56a5acfd4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr104880.C
@@ -0,0 +1,43 @@
+// { dg-do compile }
+// { dg-options "-O2 -Wno-pmf-conversions -fno-checking" }
+
+class c {
+ long b;
+};
+class B {
+public:
+ typedef void *d;
+};
+class aa {
+public:
+ aa(B::d);
+};
+class e : public B {
+public:
+ e();
+};
+unsigned int f;
+struct g {
+ struct h : c {
+ h(unsigned int &i) : c(reinterpret_cast<c &>(i)) {}
+ unsigned int ad();
+ };
+};
+class n : g {
+public:
+ n(int);
+ void j() {
+ unsigned int a;
+ h k(a);
+ __atomic_compare_exchange_n(&f, &a, k.ad(), true, 3, 0);
+ }
+};
+int l;
+class m : e {
+ void ar() {
+ n b(l);
+ b.j();
+ }
+ virtual void bd() { aa(d(&m::ar)); }
+};
+void o() { new m; }