C++ PATCH to add test for c++/92070

Marek Polacek polacek@redhat.com
Fri Oct 11 21:10:00 GMT 2019


Also fixed by r276906.

Tested on x86_64-linux, applying to trunk.

2019-10-11  Marek Polacek  <polacek@redhat.com>

	PR c++/92070 - bogus error with -fchecking=2.
	* g++.dg/expr/cond17.C: New test.

diff --git gcc/testsuite/g++.dg/expr/cond17.C gcc/testsuite/g++.dg/expr/cond17.C
new file mode 100644
index 00000000000..1999c376dd1
--- /dev/null
+++ gcc/testsuite/g++.dg/expr/cond17.C
@@ -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(); }
+};



More information about the Gcc-patches mailing list