[all-commits] [llvm/llvm-project] 233431: Do not check if we are in a discared context in no...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Tue Dec 7 09:14:27 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2334314550724812bb94e36c6b5df7d665bdbd9d
      https://github.com/llvm/llvm-project/commit/2334314550724812bb94e36c6b5df7d665bdbd9d
  Author: Corentin Jabot <corentin.jabot at gmail.com>
  Date:   2021-12-07 (Tue, 07 Dec 2021)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/test/CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp

  Log Message:
  -----------
  Do not check if we are in a discared context in non-immediate contexts

This fixes in a regression introduced by 6eeda06c1.

When deducing the return type of nested function calls, only the
return type of the outermost expression should be ignored.

Instead of assuming all contextes nested in a discared statements
are themselves discarded, only assume that in immediate contexts.

Similarly, only consider contextes immediately in an immediate or
discarded statement as being themselves immediate.




More information about the All-commits mailing list