summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/final2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/final2.C')
-rw-r--r--gcc/testsuite/g++.dg/other/final2.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/final2.C b/gcc/testsuite/g++.dg/other/final2.C
new file mode 100644
index 00000000000..a07562299d6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/final2.C
@@ -0,0 +1,27 @@
+// PR c++/53186
+// { dg-options "-fdump-tree-original -std=c++11" }
+
+struct F1
+{
+ virtual void operator()() final;
+ virtual operator int() final;
+ virtual int operator++() final;
+};
+
+struct F2 final
+{
+ virtual void operator()();
+ virtual operator int();
+ virtual int operator++();
+};
+
+void fooF1(F1& a) { a(); int m = a; ++a; }
+void fooF2(F2& a) { a(); int m = a; ++a; }
+
+// { dg-final { scan-tree-dump-times "F1::operator\\(\\)" 1 "original" } }
+// { dg-final { scan-tree-dump-times "F1::operator int" 1 "original" } }
+// { dg-final { scan-tree-dump-times "F1::operator\\+\\+" 1 "original" } }
+// { dg-final { scan-tree-dump-times "F2::operator\\(\\)" 1 "original" } }
+// { dg-final { scan-tree-dump-times "F2::operator int" 1 "original" } }
+// { dg-final { scan-tree-dump-times "F2::operator\\+\\+" 1 "original" } }
+// { dg-final { cleanup-tree-dump "original" } }