summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C')
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C b/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
new file mode 100644
index 0000000000..f658c1d7c9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C
@@ -0,0 +1,36 @@
+// PR c++/65882
+// PR c++/66467
+// { dg-do compile }
+
+template <bool>
+struct A
+{
+ typedef int type;
+};
+
+struct B
+{
+ static const int value = 0;
+};
+
+template <class>
+struct C
+{
+ typedef int type;
+};
+
+template <class>
+struct F : B {};
+
+class D
+{
+ template <class Expr>
+ typename A<F<typename C<Expr>::type>::value || B::value>::type
+ operator=(Expr); // { dg-message "private" }
+};
+
+void fn1()
+{
+ D opt;
+ opt = 0; // { dg-error "this context" }
+}