This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/80243] c++ doesn't allow function to return a struct (or object?) - same thing


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;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]