re PR c++/87425 (ICE with virtual assignment operator)
authorMarek Polacek <polacek@redhat.com>
Tue, 25 Sep 2018 18:02:47 +0000 (18:02 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 25 Sep 2018 18:02:47 +0000 (18:02 +0000)
PR c++/87425
* g++.dg/cpp2a/constexpr-virtual12.C: New test.

From-SVN: r264581

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C [new file with mode: 0644]

index 68f1c3d9a2b9c876160b90734fadc2ca2af2090c..90f54494ae958b8d1e9321137bc8a825840eb132 100644 (file)
@@ -1,3 +1,8 @@
+2018-09-25  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/87425
+       * g++.dg/cpp2a/constexpr-virtual12.C: New test.
+
 2018-09-25  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/87398
diff --git a/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C b/gcc/testsuite/g++.dg/cpp2a/constexpr-virtual12.C
new file mode 100644 (file)
index 0000000..8f28eca
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/87425
+// P1064R0
+// { dg-do compile }
+// { dg-options "-std=c++2a" }
+
+struct A
+{
+  virtual A& operator= (int);
+};
+
+struct B
+{
+  A a;
+  B() { a = 0; }
+};