[all-commits] [llvm/llvm-project] 8ba004: Stop double-diagnosing explicit convert operator i...

Erich Keane via All-commits all-commits at lists.llvm.org
Thu Apr 18 12:41:13 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8ba0041e158f8678e829c10efa73397afdba6b4f
      https://github.com/llvm/llvm-project/commit/8ba0041e158f8678e829c10efa73397afdba6b4f
  Author: Erich Keane <ekeane at nvidia.com>
  Date:   2024-04-18 (Thu, 18 Apr 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/SemaCXX/explicit.cpp

  Log Message:
  -----------
  Stop double-diagnosing explicit convert operator in switch condition (#89142)

Note this also likely fixes a bunch of other cases. We were
double-diagnosting in a template because we were generating the
expression anyway, so any attempts to instantiate the function would
instantiate the expression, thus re-diagnosing it.

This patch replaces it with a RecoveryExpr. Additionally,
VerifyIntegerConstantExpression couldn't handle the RecoveryExpr, as it
requires a non-dependent expression result (which a RecoveryExpr is
dependent). Additionally, callers of it use the return value to decide
that VerifyIntegerConstantExpression succeeded, so it fails if it sees a
RecoveryExpr.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list