aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/stmtexpr25.C
blob: 7326571dddf9a09799605548cd8d573e07a6ed95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/81073
// { dg-options "" }
// { dg-do compile { target c++11 } }
// Explicit { dg-require-effective-target exceptions_enabled } to avoid verify compiler messages FAILs for '-fno-exceptions'.

struct test { const int *addr; };

const test* setup()
{
  static constexpr test atest =
    {
      ({ static const int inner = (throw 1, 1); &inner; }) // { dg-error "static" "" }
    };

  return &atest;
}

int main(){}