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

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Tue Sep 14 02:30:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d6829bbbe6877920d9be1db93b9f3fc85b43d10
      https://github.com/llvm/llvm-project/commit/2d6829bbbe6877920d9be1db93b9f3fc85b43d10
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2021-09-14 (Tue, 14 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




More information about the All-commits mailing list