re PR c++/35332 (Broken diagnostics for builtins)
authorJakub Jelinek <jakub@redhat.com>
Wed, 26 Mar 2008 13:03:30 +0000 (14:03 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 26 Mar 2008 13:03:30 +0000 (14:03 +0100)
PR c++/35332
* error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
and LTGT_EXPR to pp_expression.

* g++.dg/other/error27.C: New test.

From-SVN: r133600

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/error27.C [new file with mode: 0644]

index 87e8c05ef1d8aeadf548bb332fa5c1dde512292d..60eb1a35b9faff4222ad480b8173886d7682ebd7 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/35332
+       * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
+       and LTGT_EXPR to pp_expression.
+
 2008-03-26  Douglas Gregor  <doug.gregor@gmail.com>
 
        * pt.c (coerce_template_template_parm): Moved the body of the loop
index 97a1785019558772466cf33717dbbe75c13acb7f..9216a44aad61041efad25c06b8bc82f292595875 100644 (file)
@@ -2048,6 +2048,14 @@ dump_expr (tree t, int flags)
     case CONJ_EXPR:
     case VECTOR_CST:
     case FIXED_CST:
+    case UNORDERED_EXPR:
+    case ORDERED_EXPR:
+    case UNLT_EXPR:
+    case UNLE_EXPR:
+    case UNGT_EXPR:
+    case UNGE_EXPR:
+    case UNEQ_EXPR:
+    case LTGT_EXPR:
       pp_expression (cxx_pp, t);
       break;
 
index 64ffcb07fcac7487298d0ec61b58bd6c621706fa..aee3aac734483bac8421b62ec019ddc3ed1f68cf 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/35332
+       * g++.dg/other/error27.C: New test.
+
 2008-03-26  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/fold-addr-1.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/other/error27.C b/gcc/testsuite/g++.dg/other/error27.C
new file mode 100644 (file)
index 0000000..70ac480
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/35332
+// { dg-do compile }
+
+void foo (double x, double y)
+{
+  __builtin_isgreater(x, y)();         // { dg-error "__builtin_\[^\n\]*cannot be used as a function" }
+  __builtin_isless(x, y)();            // { dg-error "__builtin_\[^\n\]*cannot be used as a function" }
+  __builtin_isgreaterequal(x, y)();    // { dg-error "__builtin_\[^\n\]*cannot be used as a function" }
+  __builtin_islessequal(x, y)();       // { dg-error "__builtin_\[^\n\]*cannot be used as a function" }
+  __builtin_isunordered(x, y)();       // { dg-error "__builtin_\[^\n\]*cannot be used as a function" }
+  __builtin_islessgreater(x, y)();     // { dg-error "__builtin_\[^\n\]*cannot be used as a function" }
+}