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++/65896] Erroneous uninitialized variable access error in constexpr function with temporary variables


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

David Stone <david at doublewise dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david at doublewise dot net

--- Comment #1 from David Stone <david at doublewise dot net> ---
I have simplified the test case further:


struct base {};

struct derived :  base {
        constexpr derived():
                base{},
                m_value(0) {
        }
        int m_value;
};

constexpr int by_ref(derived && value) {
        return value.m_value;
}

constexpr int value = by_ref(derived{});


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