PR c++/92070 - bogus error with -fchecking=2.
authorMarek Polacek <polacek@redhat.com>
Fri, 11 Oct 2019 20:53:26 +0000 (20:53 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Fri, 11 Oct 2019 20:53:26 +0000 (20:53 +0000)
* g++.dg/expr/cond17.C: New test.

From-SVN: r276907

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/cond17.C [new file with mode: 0644]

index bbcea404db490895b87fa303b704cb1c2267ae9b..dadb4425cc9102189c69e020a131f9d403b51140 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-11  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/92070 - bogus error with -fchecking=2.
+       * g++.dg/expr/cond17.C: New test.
+
 2019-10-11  Marek Polacek  <polacek@redhat.com>
 
        PR c++/92049 - extra error with -fchecking=2.
diff --git a/gcc/testsuite/g++.dg/expr/cond17.C b/gcc/testsuite/g++.dg/expr/cond17.C
new file mode 100644 (file)
index 0000000..1999c37
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/92070 - bogus error with -fchecking=2.
+// { dg-additional-options "-fchecking=2" }
+
+struct a;
+struct b {
+  static a c();
+};
+struct a : b {};
+template <class> struct d {
+  void e() { 0 ? b() : b::c(); }
+};