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 75f7da7..8975e6c 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 74e9a9f..3300c3f 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 6ec96c9..301b5da 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);
+}