Merge with main truk.
[official-gcc.git] / gcc / testsuite / g++.dg / init / pr29571.C
blobd0dc678cf3e55181d827b2c7303a22c4cffe90f3
1 // PR c++/29571
3 struct A
5   static const int i = 0/0 + ""; // { dg-warning "division by zero" }
6   // { dg-error "constant|conversion|initializ" "" { target *-*-* } 5 }
7   static const int j = int(i);
8 };
10 // Currently G++ complains about a non-constant initializer for 'j' in
11 // C++11 mode, but not C++98.  Either way is correct because it depends on
12 // the erroneous initializer for i, so don't require the error.
13 // { dg-prune-output ":7:" }