PR c++/68847
* call.c (build_cxx_call): Use fold_non_dependent_expr.
From-SVN: r232438
2016-01-15 Jason Merrill <jason@redhat.com>
+ PR c++/68847
+ * call.c (build_cxx_call): Use fold_non_dependent_expr.
+
* typeck2.c (cxx_incomplete_type_diagnostic): Use the location of
value.
/* We need to take care that values to BUILT_IN_NORMAL
are reduced. */
for (i = 0; i < nargs; i++)
- argarray[i] = maybe_constant_value (argarray[i]);
+ argarray[i] = fold_non_dependent_expr (argarray[i]);
if (!check_builtin_function_arguments (fndecl, nargs, argarray))
return error_mark_node;
--- /dev/null
+// PR c++/68847
+// { dg-do compile { target cas_int } }
+
+class RegionLock {
+ template <unsigned long> void m_fn1();
+ int spinlock;
+} acquire_zero;
+int acquire_one;
+template <unsigned long> void RegionLock::m_fn1() {
+ __atomic_compare_exchange(&spinlock, &acquire_zero, &acquire_one, false, 2, 2);
+}