[Bug c++/71590] G++ template function initialize with wrong type

2016-06-20 Thread markowitz73 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71590 --- Comment #4 from gliu --- (In reply to Martin Sebor from comment #3) > There is a (subtle) difference between the initialization in "std::string s > = a;" and the assignment in "std::string s; s = a;" When valid, the > initialization invokes

[Bug c++/71590] G++ template function initialize with wrong type

2016-06-20 Thread markowitz73 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71590 --- Comment #2 from gliu --- (In reply to Martin Sebor from comment #1) > It is true that there is no std::string::operator=(int) but the assignment > in 'x = a' resolves to std::string::operator(char). The program is valid. Thanks for

[Bug c++/71590] New: G++ template function initialize with wrong type

2016-06-20 Thread markowitz73 at gmail dot com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: markowitz73 at gmail dot com Target Milestone: --- The source code is as below: //source start #include template std::string func(T a, int b) { std::string x; int y; if (b == 1) { x = a; } else