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
This commit is contained in:
parent
cb8bbba89e
commit
15442c9c4f
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
11
gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C
Normal file
11
gcc/testsuite/g++.dg/cpp0x/constexpr-typedef1.C
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user