diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2017-10-18 07:53:27 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2017-10-18 07:53:27 +0000 |
commit | 1b2944cbd4da300b142524fe259fc20140396692 (patch) | |
tree | ff2d669e9966308f40e56bbdce3cf5d52ee45709 | |
parent | 257792c5e2aa931f4bf532aedd0d5d19b44567f3 (diff) | |
download | gcc-1b2944cbd4da300b142524fe259fc20140396692.zip gcc-1b2944cbd4da300b142524fe259fc20140396692.tar.gz gcc-1b2944cbd4da300b142524fe259fc20140396692.tar.bz2 |
re PR c++/69057 ([C++14] constexpr static variable template assertion segmentation fault)
2017-10-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/69057
* g++.dg/cpp1y/auto-fn45.C: New.
From-SVN: r253844
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/auto-fn45.C | 27 |
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cd8a3e6..f0f3e73 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2017-10-18 Paolo Carlini <paolo.carlini@oracle.com> + PR c++/69057 + * g++.dg/cpp1y/auto-fn45.C: New. + +2017-10-18 Paolo Carlini <paolo.carlini@oracle.com> + PR c++/68884 * g++.dg/cpp0x/variadic-crash4.C: New. diff --git a/gcc/testsuite/g++.dg/cpp1y/auto-fn45.C b/gcc/testsuite/g++.dg/cpp1y/auto-fn45.C new file mode 100644 index 0000000..a9c163d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/auto-fn45.C @@ -0,0 +1,27 @@ +// PR c++/69057 +// { dg-do compile { target c++14 } } + +#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}; +}; |