1 // PR c++/69057 2 // { dg-do compile { target c++14 } } 3 4 #include <cassert> 5 6 using GLenum = unsigned int; 7 8 template <typename T> from_enum(const T & x)9inline constexpr auto from_enum(const T& x) noexcept 10 { 11 // Comment this line to prevent segmentation fault: 12 assert(true); 13 // ------------------------------------------------ 14 15 return (GLenum)x; 16 } 17 18 enum class buffer_target : GLenum 19 { 20 array 21 }; 22 23 struct vbo 24 { 25 static constexpr GLenum target_value{from_enum(buffer_target::array)}; 26 GLenum x{target_value}; 27 }; 28