This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65896] Erroneous uninitialized variable access error in constexpr function with temporary variables
- From: "david at doublewise dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Apr 2015 01:12:25 +0000
- Subject: [Bug c++/65896] Erroneous uninitialized variable access error in constexpr function with temporary variables
- Auto-submitted: auto-generated
- References: <bug-65896-4 at http dot gcc dot gnu dot org/bugzilla/>
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{});