[all-commits] [llvm/llvm-project] 89f2c0: [clang] disable implicit moves when not in CPlusPLus

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Fri Sep 17 10:14:37 PDT 2021


  Branch: refs/heads/release/13.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 89f2c0c63c220fd5aa36279401a5cb883dfbbc34
      https://github.com/llvm/llvm-project/commit/89f2c0c63c220fd5aa36279401a5cb883dfbbc34
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2021-09-17 (Fri, 17 Sep 2021)

  Changed paths:
    M clang/lib/Sema/SemaStmt.cpp
    A clang/test/AST/nrvo.c
    A clang/test/Analysis/blocks-nrvo.c

  Log Message:
  -----------
  [clang] disable implicit moves when not in CPlusPLus

See PR51842.

This fixes an assert firing in the static analyzer, triggered by implicit moves
in blocks in C mode:

This also simplifies the AST a little bit when compiling non C++ code,
as the xvalue implicit casts are not inserted.

We keep and test that the nrvo flag is still being set on the VarDecls,
as that is still a bit beneficial while not really making anything
more complicated.

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>

Reviewed By: NoQ

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

(cherry picked from commit 2d6829bbbe6877920d9be1db93b9f3fc85b43d10)




More information about the All-commits mailing list