[all-commits] [llvm/llvm-project] e3d14b: [Concepts] Recover properly from a RecoveryExpr in...

Erich Keane via All-commits all-commits at lists.llvm.org
Mon Sep 26 06:34:13 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e3d14bee238b672a7a112311eefee55e142eaefc
      https://github.com/llvm/llvm-project/commit/e3d14bee238b672a7a112311eefee55e142eaefc
  Author: Erich Keane <erich.keane at intel.com>
  Date:   2022-09-26 (Mon, 26 Sep 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTConcept.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/include/clang/Sema/Overload.h
    M clang/lib/AST/ASTConcept.cpp
    M clang/lib/AST/ComputeDependence.cpp
    M clang/lib/Sema/SemaConcept.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Serialization/ASTReaderStmt.cpp
    M clang/lib/Serialization/ASTWriterStmt.cpp
    A clang/test/SemaTemplate/concepts-recovery-expr.cpp

  Log Message:
  -----------
  [Concepts] Recover properly from a RecoveryExpr in a concept

Discovered by reducing a different problem, we currently assert because
we failed to make the constraint expressions not dependent, since a
RecoveryExpr cannot be transformed.

This patch fixes that, and gets reasonably nice diagnostics by
introducing a concept (hah!) of "ContainsErrors" to the Satisfaction
types, which causes us to treat the candidate as non-viable.

However, just making THAT candidate non-viable would result in choosing
the 'next best' canddiate, which can result in awkward errors, where we
start evaluating a candidate that is not intended to be selected.
Because of this, and to make diagnostics more relevant, we now just
cause the entire lookup to result in a 'no-viable-candidates'.

This means we will only emit the list of candidates, rather than any
cascading failures.




More information about the All-commits mailing list