From e0f89433aa35e607de82a7d0f96d1a4cb2089717 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 30 Mar 2011 15:51:32 -0400 Subject: [PATCH] re PR c++/48369 ([C++0x] ICE in potential_constant_expression_1, at cp/semantics.c:7746) PR c++/48369 * semantics.c (potential_constant_expression_1): Handle UNORDERED_EXPR and ORDERED_EXPR. From-SVN: r171747 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/semantics.c | 2 ++ gcc/testsuite/ChangeLog | 2 ++ gcc/testsuite/g++.dg/cpp0x/regress/isnan.C | 9 +++++++++ 4 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/regress/isnan.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 75f7da727a4..8975e6cbf26 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-03-30 Jason Merrill + PR c++/48369 + * semantics.c (potential_constant_expression_1): Handle + UNORDERED_EXPR and ORDERED_EXPR. + PR c++/48281 * semantics.c (finish_compound_literal): Do put static/constant arrays in static variables. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 74e9a9f5a6f..3300c3f5b3a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -7744,6 +7744,8 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) case BIT_XOR_EXPR: case BIT_AND_EXPR: case TRUTH_XOR_EXPR: + case UNORDERED_EXPR: + case ORDERED_EXPR: case UNLT_EXPR: case UNLE_EXPR: case UNGT_EXPR: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6ec96c906fb..301b5da03a8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,7 @@ 2011-03-30 Jason Merrill + * g++.dg/cpp0x/regress/isnan.C: New. + * g++.dg/cpp0x/initlist46.C: New. 2011-03-30 Richard Sandiford diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C b/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C new file mode 100644 index 00000000000..40d07e5deef --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C @@ -0,0 +1,9 @@ +// PR c++/48369 +// { dg-options -std=gnu++0x } + +extern "C" int isnan (double); + +void f(double d) +{ + bool b = isnan(d); +} -- 2.30.2