PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / pr81308-1.C
blob508372bf5e7955e31cf9c74794dde8302bbcb13c
1 /* { dg-do compile } */
2 /* { dg-options "-w -O2 -fno-exceptions -std=c++11 -fpermissive" } */
4 namespace a {
5 template <typename b, b c> struct d { static constexpr b e = c; };
6 template <typename> struct f : d<bool, __is_trivially_copyable(int)> {};
8 typedef long g;
9 template <typename> struct h { static const bool e = a::f<int>::e; };
10 namespace a {
11 template <typename> struct ah;
12 template <typename> class ai;
14 class i {
15 public:
16   operator[](long) const {}
18 template <typename, int> class am : public i {};
19 class an;
20 class k : public am<a::ai<an>, h<a::ai<a::ah<an>>>::e> {};
21 class l {
22 public:
23   aq();
25 class ar extern as;
26 typedef k at;
27 class m {
28   virtual bool av(int, unsigned &, at &, int &, g &, bool);
30 class ar {
31 public:
32   typedef m *aw(const &, int &, const &, const &);
34 struct ax {
35   static ay(ar::aw);
37 template <class az> struct n {
38   n(ar) { ax::ay(ba); }
39   static m *ba(const &bb, int &bc, const &bd, const &be) { az(bb, bc, bd, be); }
41 namespace {
42 class G : m {
43   unsigned bi(const at &, l &);
44   bool av(int, unsigned &, at &, int &, g &, bool);
46 public:
47   G(const, int, const, const) {}
50 bool G::av(int, unsigned &, at &bl, int &, g &, bool) {
51   l bo;
52   bi(bl, bo);
54 o() { n<G> bp(as); }
55 namespace {
56 enum { bq, br };
58 unsigned G::bi(const at &bl, l &bo) {
59   unsigned bs;
60   for (char *j;; j += 2)
61     switch (*j) {
62     case bq:
63       bl[bs];
64     case br:
65       bo.aq();
66     }