the first time. */
tree result;
+ /* For a !ATOMIC_CONSTR_MAP_INSTANTIATED_P atom, this conveniently points to
+ the entry for the corresponding atom after instantiating its mapping. */
+ sat_entry *inst_entry;
+
/* The value of input_location when satisfaction of ATOM+ARGS was first
performed. */
location_t location;
entry->atom = atom;
entry->args = args;
entry->result = NULL_TREE;
+ entry->inst_entry = nullptr;
entry->location = input_location;
entry->ftc_begin = entry->ftc_end = -1;
entry->diagnose_instability = false;
{
/* If we get here, it means satisfaction is self-recursive. */
gcc_checking_assert (!entry->result || seen_error ());
+ /* Prefer printing the instantiated mapping. */
+ tree atom = entry->inst_entry ? entry->inst_entry->atom : entry->atom;
if (info.noisy ())
- error_at (EXPR_LOCATION (ATOMIC_CONSTR_EXPR (entry->atom)),
+ error_at (EXPR_LOCATION (ATOMIC_CONSTR_EXPR (atom)),
"satisfaction of atomic constraint %qE depends on itself",
- entry->atom);
+ atom);
return error_mark_node;
}
gcc_assert (!ATOMIC_CONSTR_MAP_INSTANTIATED_P (t));
ATOMIC_CONSTR_MAP_INSTANTIATED_P (t) = true;
satisfaction_cache inst_cache (t, /*args=*/NULL_TREE, info);
+ if (cache.entry && inst_cache.entry)
+ cache.entry->inst_entry = inst_cache.entry;
if (tree r = inst_cache.get ())
{
cache.entry->location = inst_cache.entry->location;
struct A { };
-template<typename T> concept pipeable = requires(A a, T t) { a | t; }; // { dg-error "depends on itself" }
+template<typename T> concept pipeable = requires(A a, T t) { a | t; };
+// { dg-error "with T = int]' depends on itself" "" { target *-*-* } .-1 }
template<pipeable T> void operator|(A, T);