[all-commits] [llvm/llvm-project] 426675: Fix recursive error for constraints depending on i...

Erich Keane via All-commits all-commits at lists.llvm.org
Fri Jan 27 11:12:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 42667563721e139a93ab886119ea2780ebc3fecc
      https://github.com/llvm/llvm-project/commit/42667563721e139a93ab886119ea2780ebc3fecc
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2023-01-27 (Fri, 27 Jan 2023)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaConcept.cpp
    M clang/test/SemaTemplate/concepts-recursive-inst.cpp

  Log Message:
  -----------
  Fix recursive error for constraints depending on itself incorrectly

Fixes: #60323

https://github.com/llvm/llvm-project/issues/60323

The problem is that we are profiling the 'Expr' components directly,
however when they contain an unresolved lookup, those canonicalize
identically.  The result was the two versions of calls to 'go' were
canonicalized identically.

This patch fixes this by ensuring we consider the declaration the
constraint is attached to, when possible.  When not, we skip the
diagnostic.

The result is that we are relaxing our diagnostic in some cases (Of
which I couldn't come up with a reproducer), such that we might see
overflows when evaluating constraints that depend on themselves in a way
that they are not attached to a declaration directly, such as if
they are nested requirements, though the hope is this won't be a
problem, since the 'parent' named constraint would catch this.  I'm
hopeful that the 'worst case' is that we catch recursion 'later' in the
process, instead of immediately.




More information about the All-commits mailing list