https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83556

--- Comment #1 from Paolo Pettinato <p.pettinato+gcc at gmail dot com> ---
gcc 5.4.0 (Ubuntu Xenial, x86_64-linux-gnu) gives a more reasonable output:

$ g++ test.cpp -o a
test.cpp:8:21: warning: non-static data member initializers only available with
-std=c++11 or -std=gnu++11
     int good = func();
                     ^
test.cpp:9:15: warning: non-static data member initializers only available with
-std=c++11 or -std=gnu++11
     int bad = 1;
               ^
test.cpp:10:37: warning: non-static data member initializers only available
with -std=c++11 or -std=gnu++11
     int ugly = good ? 1 * bad : 2 * bad;
                                     ^
test.cpp:15:12: warning: non-static data member initializers only available
with -std=c++11 or -std=gnu++11
     Data d{};
            ^
test.cpp:15:11: warning: extended initializer lists only available with
-std=c++11 or -std=gnu++11
     Data d{};
           ^
test.cpp:15:12: warning: extended initializer lists only available with
-std=c++11 or -std=gnu++11
     Data d{};
            ^
test.cpp: In function 'int main()':
test.cpp:20:15: warning: extended initializer lists only available with
-std=c++11 or -std=gnu++11
     MoreData m{};
               ^
test.cpp:20:16: error: in C++98 'm' must be initialized by constructor, not by
'{...}'
     MoreData m{};
                ^

Reply via email to