[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2022-04-28 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Marek Polacek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #10 from Marek Polacek  ---
Fixed.

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2021-11-12 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

--- Comment #9 from Marek Polacek  ---
Comment 3 was fixed in r11-7102.

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2021-11-12 Thread wjwray at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Will Wray  changed:

   What|Removed |Added

 CC||wjwray at gmail dot com

--- Comment #8 from Will Wray  ---
This can be marked RESOLVED, fixed in gcc11, same as the referenced duplicates.

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2020-09-25 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #7 from Marek Polacek  ---
Related:

const char (&)[5] = {"abc"};

This should work, see [dcl.init.list]/3.10, we should create a temporary of the
referenced type and bind the reference to it.

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2020-09-04 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Marek Polacek  changed:

   What|Removed |Added

 CC||kirshamir at gmail dot com

--- Comment #6 from Marek Polacek  ---
*** Bug 96936 has been marked as a duplicate of this bug. ***

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2019-11-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #5 from Marek Polacek  ---
Somewhat related to my P0960 patch where I needed to handle initializing from
("foo") too.

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2019-11-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Jonathan Wakely  changed:

   What|Removed |Added

 CC||michael.kenzel at gmail dot com

--- Comment #4 from Jonathan Wakely  ---
*** Bug 92579 has been marked as a duplicate of this bug. ***

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2019-11-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed|2018-03-28 00:00:00 |2019-11-19

--- Comment #3 from Jonathan Wakely  ---
It doesn't work in a return statement either:

struct array { char data[2]; };

void f(array) {}

array g() {
f({"a"});
return {"a"};
}


84930.cc: In function ‘array g()’:
84930.cc:6:12: error: could not convert ‘{"a"}’ from ‘’ to ‘array’
 f({"a"});
^
84930.cc:7:16: error: could not convert ‘{"a"}’ from ‘’ to ‘array’
 return {"a"};
^

[Bug c++/84930] Brace-closed initialization of cstring (i.e."abcdefghi") to coresponding aggregate types fails in certain situation

2018-03-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84930

Jonathan Wakely  changed:

   What|Removed |Added

  Component|libstdc++   |c++

--- Comment #2 from Jonathan Wakely  ---
This is a front-end bug not library bug, the failing cases can be reduced to:

struct array { char data[10]; };

struct A {
  array x; 
  A(array arr) : x(arr) {}
};
A struct_from_ctr1{ {{"abcdefghi"}} };


Or even more simply:

struct array { char data[2]; };

void f(array) {}

void g() {
f({{"a"}});
}