On 3/11/20 4:18 PM, Patrick Palka via Gcc-patches wrote:
...
Hmm, like this?  This version introduces a new static member function
diagnosing_failed_constraint::replay_errors_p that checks
current_constraint_diagnosis_depth, and also sets max_depth_exceeded_p
when appropriate.

...

Just one small quoting nit:


@@ -3368,11 +3464,25 @@ diagnose_constraints (location_t loc, tree t, tree args)
  {
    inform (loc, "constraints not satisfied");
+ if (concepts_diagnostics_max_depth == 0)
+    return;
+
    /* Replay satisfaction, but diagnose errors.  */
    if (!args)
      constraint_satisfaction_value (t, tf_warning_or_error);
    else
      constraint_satisfaction_value (t, args, tf_warning_or_error);
+
+  static bool suggested_p;
+  if (concepts_diagnostics_max_depth_exceeded_p
+      && current_constraint_diagnosis_depth == 0
+      && !suggested_p)
+    {
+      inform (UNKNOWN_LOCATION,
+             "set -fconcepts-diagnostics-depth= to at least %d for more 
detail",
+             concepts_diagnostics_max_depth + 1);


Can you please quote the option name in the diagnostic (e.g., by using
"set %qs to...", "-fconcepts-diagnostics-depth=" or equivalent) to avoid
-Wformat-diag?  It won't cause errors (yet) but will eventually need to
be cleaned up.

Thanks
Martin

Reply via email to