2018-04-04 Jakub Jelinek <jakub@redhat.com>
+ PR inline-asm/85172
+ * constexpr.c (cxx_eval_builtin_function_call): For calls to
+ builtin_valid_in_constant_expr_p functions, don't call
+ cxx_eval_constant_expression if argument is not
+ potential_constant_expression.
+
PR c++/85146
* cp-tree.h (calculate_bases, calculate_direct_bases): Add complain
argument.
bool dummy1 = false, dummy2 = false;
for (i = 0; i < nargs; ++i)
{
- args[i] = cxx_eval_constant_expression (&new_ctx, CALL_EXPR_ARG (t, i),
- false, &dummy1, &dummy2);
+ args[i] = CALL_EXPR_ARG (t, i);
+ /* If builtin_valid_in_constant_expr_p is true,
+ potential_constant_expression_1 has not recursed into the arguments
+ of the builtin, verify it here. */
+ if (!builtin_valid_in_constant_expr_p (fun)
+ || potential_constant_expression (args[i]))
+ args[i] = cxx_eval_constant_expression (&new_ctx, args[i], false,
+ &dummy1, &dummy2);
if (bi_const_p)
/* For __built_in_constant_p, fold all expressions with constant values
even if they aren't C++ constant-expressions. */
2018-04-04 Jakub Jelinek <jakub@redhat.com>
+ PR inline-asm/85172
+ * g++.dg/ext/builtin13.C: New test.
+ * g++.dg/ext/atomic-4.C: New test.
+
PR c++/85146
* g++.dg/ext/bases2.C: Expect extra error diagnostics.
* g++.dg/ext/bases3.C: New test.