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;
}