[all-commits] [llvm/llvm-project] 095033: Fix false positive with unreachable C++ catch hand...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue Mar 14 08:08:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0950332e91df0281c386874c45d7ce33b7da495b
      https://github.com/llvm/llvm-project/commit/0950332e91df0281c386874c45d7ce33b7da495b
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2023-03-14 (Tue, 14 Mar 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaStmt.cpp
    M clang/test/CXX/drs/dr3xx.cpp
    M clang/test/SemaCXX/unreachable-catch-clauses.cpp

  Log Message:
  -----------
  Fix false positive with unreachable C++ catch handlers

This addresses an issue found by WG21 and tracked by CWG2699 (which is
not yet publicly published). The basic problem is that Clang issues a
diagnostic about not being able to reach a handler, but that handler
*is* reached at runtime. Clang's diagnostic behavior was matching the
standard wording, and our runtime behavior was matching the standard's
intent.

This fixes the diagnostic so that it matches the runtime behavior more
closely, and reduces the number of false positives. This is the
direction of choice taken by Core for CWG2699 and it seems unlikely
that WG21 will change direction here.

Fixes https://github.com/llvm/llvm-project/issues/61177
Differential Revision: https://reviews.llvm.org/D145408




More information about the All-commits mailing list