diff options
author | Jason Merrill <jason@redhat.com> | 2011-09-26 22:12:42 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-09-26 22:12:42 -0400 |
commit | 15442c9c4fc7bb169629a75c170d801e9fa07fd7 (patch) | |
tree | 0137508a143f6407bb5e58b2b1e443359dc09c28 /gcc | |
parent | cb8bbba89e8db9b585dd0d3935ffef5e77920d5a (diff) | |
download | gcc-15442c9c4fc7bb169629a75c170d801e9fa07fd7.zip gcc-15442c9c4fc7bb169629a75c170d801e9fa07fd7.tar.gz gcc-15442c9c4fc7bb169629a75c170d801e9fa07fd7.tar.bz2 |
re PR c++/50508 ([C++0x] ICE cxx_eval_logical_expression cp/semantics.c:6487)
PR c++/50508
* semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal
rather than ==.
From-SVN: r179228
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C | 11 |
4 files changed, 24 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9de69c8..0efa0d6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-09-26 Jason Merrill <jason@redhat.com> + + PR c++/50508 + * semantics.c (cxx_eval_logical_expression): Use tree_int_cst_equal + rather than ==. + 2011-09-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/45487 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 19ecbee..89c76d5a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6680,9 +6680,9 @@ cxx_eval_logical_expression (const constexpr_call *call, tree t, allow_non_constant, addr, non_constant_p); VERIFY_CONSTANT (lhs); - if (lhs == bailout_value) + if (tree_int_cst_equal (lhs, bailout_value)) return lhs; - gcc_assert (lhs == continue_value); + gcc_assert (tree_int_cst_equal (lhs, continue_value)); r = cxx_eval_constant_expression (call, TREE_OPERAND (t, 1), allow_non_constant, addr, non_constant_p); VERIFY_CONSTANT (r); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ebc9385..bc362ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-09-26 Jason Merrill <jason@redhat.com> + + PR c++/50508 + * g++.dg/cpp0x/constexpr-typedef1.C: New. + 2011-09-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/45487 diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C new file mode 100644 index 0000000..2719e3a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C @@ -0,0 +1,11 @@ +// PR c++/50508 +// { dg-options -std=c++0x } + +template <class T> + struct integral_constant { + typedef T value_type; + constexpr operator value_type() { return true; } + }; + +static constexpr bool value = integral_constant<bool>() + && true; |