This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69057] New: constexpr static variable template assertion segmentation fault
- From: "vittorio.romeo at outlook dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 26 Dec 2015 15:30:10 +0000
- Subject: [Bug c++/69057] New: constexpr static variable template assertion segmentation fault
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69057
Bug ID: 69057
Summary: constexpr static variable template assertion
segmentation fault
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: vittorio.romeo at outlook dot com
Target Milestone: ---
gcc.godbolt.org example: https://goo.gl/yGCVOB
---
#include <cassert>
using GLenum = unsigned int;
template <typename T>
inline constexpr auto from_enum(const T& x) noexcept
{
// Comment this line to prevent segmentation fault:
assert(true);
// ------------------------------------------------
return (GLenum)x;
}
enum class buffer_target : GLenum
{
array
};
struct vbo
{
static constexpr GLenum target_value{from_enum(buffer_target::array)};
GLenum x{target_value};
};
int main()
{
return 0;
}