[Bug c++/29824] New: std::string() causes assignment errors

2006-11-13 Thread diltsman at gmail dot com
#include 

int main()
{
std::string a();
a="alskdfjasdj";
return 0;
}

output:
test.cpp: In function int main():
test.cpp:6: error: assignment of function std::string a()
test.cpp:6: error: cannot convert const char [12] to std::string ()() in
assignment

#include 

int main()
{
std::string a("");
a="alskdfjasdj";
return 0;
}

This compiles.

My understanding is that std::string a() and std::string a("") should have
exactly the same result, such that the assignment of the c-string should be
valid in both situations.


-- 
   Summary: std::string() causes assignment errors
   Product: gcc
   Version: 4.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: diltsman at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29824



[Bug c++/29824] std::string() causes assignment errors

2006-11-13 Thread diltsman at gmail dot com


--- Comment #1 from diltsman at gmail dot com  2006-11-14 05:18 ---
I neglected to comment that the command line was:
g++ test.cpp


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29824