https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80243

            Bug ID: 80243
           Summary: c++ doesn't allow function to return a struct (or
                    object?) - same thing
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jmichae3 at yahoo dot com
  Target Milestone: ---

c++ doesn't allow function to return a struct.  and notice a class is a struct
with a constructur function and destructor function but has auto-start.

#include <string>
#include <initializer_list>
typedef struct {std::string s;int i;} Structsb;
Structsb fn(std::string s1, int i1) {
    return {s1,i1};
}

I should be able to do this with objects which are instantiations of a class
too.

Reply via email to