struct Derived {
  Derived(int i):i(i){}
  int i;
};

Derived d(3); 

Generates a constructor function to call Derived() constructor. Would be nice
if this was inlined into a static initializer, ie the declaration would become
Derived d = {3}.

This is useful where Derived has a vtable, so one can't use POD-initialization.

When Derived d is a global variable, this causes a .ctors entry for it which
slows down app startup.


-- 
           Summary: Inline constructors into static initializers
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tglek at mozilla dot com


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

Reply via email to