[Bug c++/60009] g++ allows copy-initialization of an array of class type from a non-braced string literal

2021-10-06 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60009

Patrick Palka  changed:

   What|Removed |Added

 CC||ppalka at gcc dot gnu.org

--- Comment #4 from Patrick Palka  ---
(In reply to Andrew Pinski from comment #3)
> Fixed in GCC 7, I cannot figure out which revision fixed it though.
> 
> Note r8-7514 fixes the error message though where in GCC 7 would print out
> some error messages dealing with no matching of constructors.

Fixed by r7-7236 FWIW

[Bug c++/60009] g++ allows copy-initialization of an array of class type from a non-braced string literal

2021-07-27 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60009

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=84632
 Resolution|--- |FIXED
   Target Milestone|--- |7.0
 Status|NEW |RESOLVED

--- Comment #3 from Andrew Pinski  ---
Fixed in GCC 7, I cannot figure out which revision fixed it though.

Note r8-7514 fixes the error message though where in GCC 7 would print out some
error messages dealing with no matching of constructors.

[Bug c++/60009] g++ allows copy-initialization of an array of class type from a non-braced string literal

2014-12-14 Thread ville.voutilainen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60009

Ville Voutilainen ville.voutilainen at gmail dot com changed:

   What|Removed |Added

   Keywords||accepts-invalid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-12-14
 CC||ville.voutilainen at gmail dot 
com
 Ever confirmed|0   |1
  Known to fail||4.8.2, 4.9.1, 5.0

--- Comment #2 from Ville Voutilainen ville.voutilainen at gmail dot com ---
Clang rejects the code.


[Bug c++/60009] g++ allows copy-initialization of an array of class type from a non-braced string literal

2014-06-24 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60009

TC rs2740 at gmail dot com changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #1 from TC rs2740 at gmail dot com ---
http://stackoverflow.com/questions/24378882/weird-gcc-array-initialization-behavior
appears to be related.

Minimal example:

struct A { A() { } };
int main() { A a[10] = A(); }

Compiles with GCC 4.6, 4.7, 4.8 and 4.9, in both C++98 and C++11 modes, even
though it shouldn't. However,

struct A { };
int main() { A a[10] = A(); }

does not compile in any of the GCC versions tested.

struct A { A() = default; };
int main() { A a[10] = A(); }

Compiles with GCC 4.9 in C++11 mode; does not compile with 4.6-4.8 in C++ 11
mode, however.