diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-03-17 14:53:05 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-03-17 14:53:05 +0000 |
commit | 50e4d1ec16071cdfb0df267afb943c9117e9a66e (patch) | |
tree | 11c2c1db09f2d99cd1705854c6cd7fa8ae631984 /gcc | |
parent | ab2ffbeb332afb09e6603e3a8a96e5d7f1f3e3c6 (diff) | |
download | gcc-50e4d1ec16071cdfb0df267afb943c9117e9a66e.zip gcc-50e4d1ec16071cdfb0df267afb943c9117e9a66e.tar.gz gcc-50e4d1ec16071cdfb0df267afb943c9117e9a66e.tar.bz2 |
re PR c++/59571 ([C++11] ICE when casting inside static member constexpr brace initializer)
/cp
2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59571
* typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae.
/testsuite
2014-03-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59571
* g++.dg/cpp0x/constexpr-ice13.C: New.
From-SVN: r208619
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-ice13.C | 8 |
4 files changed, 19 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ca2f8c1..5b52060 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-03-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/59571 + * typeck2.c (check_narrowing): Use fold_non_dependent_expr_sfinae. + 2014-03-14 Jason Merrill <jason@redhat.com> PR c++/60532 diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 3a4caa0..bd21ad8 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -861,7 +861,7 @@ check_narrowing (tree type, tree init) return; } - init = maybe_constant_value (init); + init = maybe_constant_value (fold_non_dependent_expr_sfinae (init, tf_none)); if (TREE_CODE (type) == INTEGER_TYPE && TREE_CODE (ftype) == REAL_TYPE) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 063680e..51cdaaf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-03-17 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/59571 + * g++.dg/cpp0x/constexpr-ice13.C: New. + 2014-03-17 Marek Polacek <polacek@redhat.com> PR middle-end/60534 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ice13.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice13.C new file mode 100644 index 0000000..4fe3716 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ice13.C @@ -0,0 +1,8 @@ +// PR c++/59571 +// { dg-do compile { target c++11 } } + +template <class> +struct foo +{ + static constexpr int bar{(int)-1}; +}; |