Commit 07874f1f by Jakub Jelinek Committed by Jakub Jelinek

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
parent 4990038d
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> 2008-03-26 Douglas Gregor <doug.gregor@gmail.com>
* pt.c (coerce_template_template_parm): Moved the body of the loop * pt.c (coerce_template_template_parm): Moved the body of the loop
......
...@@ -2048,6 +2048,14 @@ dump_expr (tree t, int flags) ...@@ -2048,6 +2048,14 @@ dump_expr (tree t, int flags)
case CONJ_EXPR: case CONJ_EXPR:
case VECTOR_CST: case VECTOR_CST:
case FIXED_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); pp_expression (cxx_pp, t);
break; break;
......
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> 2008-03-26 Richard Guenther <rguenther@suse.de>
* gcc.dg/fold-addr-1.c: New testcase. * gcc.dg/fold-addr-1.c: New testcase.
// 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" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment