[all-commits] [llvm/llvm-project] 7b0396: [Clang][Sema] Fix crash when type used in return s...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Mon Jan 29 10:08:22 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7b0396faabce0cec470779ae5e3a851bedb2ac12
      https://github.com/llvm/llvm-project/commit/7b0396faabce0cec470779ae5e3a851bedb2ac12
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaStmt.cpp
    M clang/test/SemaCXX/deduced-return-type-cxx14.cpp

  Log Message:
  -----------
  [Clang][Sema] Fix crash when type used in return statement contains errors (#79788)

In Sema in `BuildReturnStmt(...)` when we try to determine is the type
is move eligible or copy elidable we don't currently check of the init
of the `VarDecl` contain errors or not. This can lead to a crash since
we may send a type that is not complete into `getTypeInfo(...)` which
does not allow this.

This fixes: https://github.com/llvm/llvm-project/issues/63244
https://github.com/llvm/llvm-project/issues/79745




More information about the All-commits mailing list