aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/expr.c')
-rw-r--r--gcc/cp/expr.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 6d2d658..71dec3d 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -91,18 +91,24 @@ cplus_expand_constant (tree cst)
return cst;
}
-/* Called whenever an expression is used
- in a rvalue context. */
-
+/* Called whenever the expression EXPR is used in an rvalue context.
+ When REJECT_BUILTIN is true the expression is checked to make sure
+ it doesn't make it possible to obtain the address of a GCC built-in
+ function with no library fallback (or any of its bits, such as in
+ a conversion to bool). */
tree
-mark_rvalue_use (tree expr)
+mark_rvalue_use (tree expr,
+ location_t loc /* = UNKNOWN_LOCATION */,
+ bool reject_builtin /* = true */)
{
+ if (reject_builtin && reject_gcc_builtin (expr, loc))
+ return error_mark_node;
+
mark_exp_read (expr);
return expr;
}
-/* Called whenever an expression is used
- in a lvalue context. */
+/* Called whenever an expression is used in an lvalue context. */
tree
mark_lvalue_use (tree expr)