[all-commits] [llvm/llvm-project] 61760b: [analyzer] Bind return value for assigment and cop...

tomasz-kaminski-sonarsource via All-commits all-commits at lists.llvm.org
Mon Jul 17 23:46:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 61760bb98c4694651261b2e10df3fa6f669098ed
      https://github.com/llvm/llvm-project/commit/61760bb98c4694651261b2e10df3fa6f669098ed
  Author: Tomasz Kamiński <tomasz.kamiński at sonarsource.com>
  Date:   2023-07-18 (Tue, 18 Jul 2023)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
    A clang/test/Analysis/ctor-trivial-copy.cpp

  Log Message:
  -----------
  [analyzer] Bind return value for assigment and copies of trivial empty classes

We now properly bind return value of the trivial copy constructor
and assignments of the empty objects. Such operations do not
perform any loads from the source, however they preserve identity
of the assigned object:
```
Empty e;
auto& x = (e = Empty());
clang_analyzer_dump(x); // &e, was Unknown
```

Reviewed By: xazax.hun

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




More information about the All-commits mailing list