This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/80243] c++ doesn't allow function to return a struct (or object?) - same thing
- From: "jmichae3 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Mar 2017 21:06:17 +0000
- Subject: [Bug c++/80243] c++ doesn't allow function to return a struct (or object?) - same thing
- Auto-submitted: auto-generated
- References: <bug-80243-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80243
--- Comment #1 from Jim Michaels <jmichae3 at yahoo dot com> ---
#include <string>
#include <initializer_list>
typedef struct {std::string s;int i;} Structsb;
Structsb fn(std::string s1, int i1) {
return {s1,i1};
}
int main() {}
Structsb structsb=fn("string",1);
return strustsb.i;
}