For now, disallow lifetime-extended temporaries with non-trivial (but
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 29 Sep 2019 06:22:54 +0000 (06:22 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sun, 29 Sep 2019 06:22:54 +0000 (06:22 +0000)
commit1e8c0850b1f58752c7c0174ed703e8215b2a4d31
tree61fea645ec7785800228fb29b9732bc49440b2c6
parent4566f87649cc12063c8234e70e34b3a2b393679e
For now, disallow lifetime-extended temporaries with non-trivial (but
constexpr) destructors from being used in the values of constexpr
variables.

The standard rules here are unclear at best, so rejecting the
problematic cases seems prudent. Prior to this change, we would fail to
run the destructors for these temporaries, even if they had
side-effects, which is certainly not the right behavior.

llvm-svn: 373161
clang/include/clang/Basic/DiagnosticASTKinds.td
clang/lib/AST/ExprConstant.cpp
clang/test/SemaCXX/constant-expression-cxx2a.cpp