[Bug c++/101850] Initialising a struct/class variable to itself does not fail at compile time (but throws std::bad_alloc at run time, as expected)

2021-08-10 Thread prasantabehera at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101850 --- Comment #4 from Prasanta Behera --- FWIW clang++ does produce these warnings: ~$ cat t.cpp #include class M { std::string s; public: M(std::string t) : s(t) {} }; int main() { std::string s = s; M m = m; return 0; } ~$ clang+

[Bug c++/101850] New: Initialising a std::string variable to itself does not fail at compile time, but throws std::bad_alloc at run time

2021-08-10 Thread prasantabehera at hotmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101850 Bug ID: 101850 Summary: Initialising a std::string variable to itself does not fail at compile time, but throws std::bad_alloc at run time Product: gcc Version: