aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/g++.dg/init/pr29571.C
blob: d0dc678cf3e55181d827b2c7303a22c4cffe90f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// PR c++/29571

struct A
{
  static const int i = 0/0 + ""; // { dg-warning "division by zero" }
  // { dg-error "constant|conversion|initializ" "" { target *-*-* } 5 }
  static const int j = int(i);
};

// Currently G++ complains about a non-constant initializer for 'j' in
// C++11 mode, but not C++98.  Either way is correct because it depends on
// the erroneous initializer for i, so don't require the error.
// { dg-prune-output ":7:" }