[all-commits] [llvm/llvm-project] 96c899: C++ DR2026: static storage duration variables are ...

Richard Smith via All-commits all-commits at lists.llvm.org
Thu Feb 6 16:37:32 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 96c899449b61b866b583560a49c4627f561336fc
      https://github.com/llvm/llvm-project/commit/96c899449b61b866b583560a49c4627f561336fc
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-02-06 (Thu, 06 Feb 2020)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/CodeGen/CGExprConstant.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/test/CXX/drs/dr20xx.cpp
    M clang/test/CXX/special/class.init/class.inhctor.init/p1.cpp
    M clang/test/CodeGenCXX/cxx2a-thread-local-constinit.cpp
    M clang/test/SemaCXX/attr-require-constant-initialization.cpp
    M clang/test/SemaCXX/constant-expression-cxx11.cpp
    M clang/test/SemaCXX/constant-expression-cxx1y.cpp
    M clang/test/SemaCXX/constexpr-printing.cpp
    M clang/test/SemaCXX/constexpr-value-init.cpp
    M clang/test/SemaTemplate/instantiate-self.cpp
    M clang/www/cxx_dr_status.html

  Log Message:
  -----------
  C++ DR2026: static storage duration variables are not zeroed before
constant initialization.

Removing this zeroing regressed our code generation in a few cases, also
fixed here. We now compute whether a variable has constant destruction
even if it doesn't have a constant initializer, by trying to destroy a
default-initialized value, and skip emitting a trivial default
constructor for a variable even if it has non-trivial (but perhaps
constant) destruction.




More information about the All-commits mailing list