diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/diagnostic/inhibit-warn-2.C | 36 |
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 00000000000..cb16b4cef8d --- /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 "declared" } +}; + +void fn1() +{ + D opt; + opt = 0; // { dg-error "private" } +} |