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++/86135] New: At run time, when the constructor tries to construct an objects element with a initializer-list (using c++11 style) is giving segmentation fault. The old style of initialize with parenthesis is working properly.


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

            Bug ID: 86135
           Summary: At run time, when the constructor tries to construct
                    an objects element  with a initializer-list (using
                    c++11 style) is giving segmentation fault.  The old
                    style of initialize  with parenthesis is working
                    properly.
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sabetaytoros at gmail dot com
  Target Milestone: ---

Operating System Windows 8. 
Compiler On internet wandbox.org gcc HEAD 9.0 2018O6 
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.67.0/gcc-head/include
-std=gnu++2a

Issue :
Initializing an element with angel brackets does not work.  Paranthesis is
working.

        struct TConcept {
            virtual ~TConcept() = default;
            virtual void ModelDraw(ostream& os) const = 0;
        };
        shared_ptr<const TConcept> Self;
        template<typename T>
        struct TModel final : TConcept {
            TModel(T e) : Data { move(e) } { }
    // It seems the issue is in this line, initiliazer list C++11 version does
not work 
    //        TModel(T e) : Data ( move(e) ) { }
    // C++98 style is working.          
            void ModelDraw(ostream& os) const {
                Draw(os, Data);
            }
            T Data;
        };

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