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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is not a bug. In C++11 the default member-initializer means that the type
is not an aggregate, so you cannot use aggregate-initialization to create it.
In C++14 aggregates are allowed to have default member-initializers, so you can
use aggregate-initialization syntax to create it.

i.e. this is valid in C++14 but not in C++11:

struct option_s
{
  int parameter = 1 ;
};

option_s o = { 1 };


So either you need to say option_s{1} or you need to compile as C++14.

If it works in Visual Studio that's because it doesn't conform to C++11, or you
are not using the right options to select C++11 conformance.

Reply via email to