[all-commits] [llvm/llvm-project] ff8aad: [clang][diagnostics] Don't warn about unreachable ...

Alan Zhao via All-commits all-commits at lists.llvm.org
Mon Aug 15 12:24:52 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff8aadf58d1a0ea7d8fa2b9a7a17ff0c6059baa5
  Author: Alan Zhao <ayzhao at google.com>
  Date:   2022-08-15 (Mon, 15 Aug 2022)

  Changed paths:
    M clang/lib/Analysis/ReachableCode.cpp
    M clang/test/SemaCXX/unreachable-code.cpp

  Log Message:
  [clang][diagnostics] Don't warn about unreachable code in constexpr if

The point of a constexpr if statement is to determine which branch to
take at compile time, so warning on unreachable code is meaningless in
these situations.

Fixes #57123.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D131818

More information about the All-commits mailing list