From: Jakub Jelinek Date: Wed, 26 Mar 2008 13:03:30 +0000 (+0100) Subject: re PR c++/35332 (Broken diagnostics for builtins) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07874f1f63c1b1d1686e5b8e0cb9e42515beca21;p=gcc.git re PR c++/35332 (Broken diagnostics for builtins) 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 87e8c05ef1d..60eb1a35b9f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-03-26 Jakub Jelinek + + 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 * pt.c (coerce_template_template_parm): Moved the body of the loop diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 97a17850195..9216a44aad6 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 64ffcb07fca..aee3aac7344 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-03-26 Jakub Jelinek + + PR c++/35332 + * g++.dg/other/error27.C: New test. + 2008-03-26 Richard Guenther * 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 index 00000000000..70ac480ee3e --- /dev/null +++ b/gcc/testsuite/g++.dg/other/error27.C @@ -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" } +}