re PR c++/48369 ([C++0x] ICE in potential_constant_expression_1, at cp/semantics...
authorJason Merrill <jason@redhat.com>
Wed, 30 Mar 2011 19:51:32 +0000 (15:51 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 30 Mar 2011 19:51:32 +0000 (15:51 -0400)
PR c++/48369
* semantics.c (potential_constant_expression_1): Handle
UNORDERED_EXPR and ORDERED_EXPR.

From-SVN: r171747

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/regress/isnan.C [new file with mode: 0644]

index 75f7da727a4717f9ca5bf00b958b3e64fc09654f..8975e6cbf260d691bf4d4bbf32d4636225e7a305 100644 (file)
@@ -1,5 +1,9 @@
 2011-03-30  Jason Merrill  <jason@redhat.com>
 
+       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.
index 74e9a9f5a6f12ce39afc48a405b84fedb9280635..3300c3f5b3a0aa9714427653eaf4baf7692158b7 100644 (file)
@@ -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:
index 6ec96c906fb94bfba4325268ca57ec8ce9359998..301b5da03a85c2588f54125645207eacb095e073 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-30  Jason Merrill  <jason@redhat.com>
 
+       * g++.dg/cpp0x/regress/isnan.C: New.
+
        * g++.dg/cpp0x/initlist46.C: New.
 
 2011-03-30  Richard Sandiford  <richard.sandiford@linaro.org>
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C b/gcc/testsuite/g++.dg/cpp0x/regress/isnan.C
new file mode 100644 (file)
index 0000000..40d07e5
--- /dev/null
@@ -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);
+}