diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-29 06:22:54 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-29 06:22:54 +0000 |
commit | 38090e137eba6c5df0027b61ffb2b724438d8078 (patch) | |
tree | 3febce3bc7b2b975bed6f943746ba9e5de941dce /include/clang | |
parent | 9a10e4b7c930cab5f4a8fc6f74e157e44fba807f (diff) | |
download | clang-38090e137eba6c5df0027b61ffb2b724438d8078.tar.gz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Basic/DiagnosticASTKinds.td | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td index eb2a1f02fd..f4eeebd73a 100644 --- a/include/clang/Basic/DiagnosticASTKinds.td +++ b/include/clang/Basic/DiagnosticASTKinds.td @@ -210,6 +210,9 @@ def note_constexpr_destroy_out_of_lifetime : Note< "destroying object '%0' whose lifetime has already ended">; def note_constexpr_unsupported_destruction : Note< "non-trivial destruction of type %0 in a constant expression is not supported">; +def note_constexpr_unsupported_tempoarary_nontrivial_dtor : Note< + "non-trivial destruction of lifetime-extended temporary with type %0 " + "used in the result of a constant expression is not yet supported">; def note_constexpr_unsupported_unsized_array : Note< "array-to-pointer decay of array member without known bound is not supported">; def note_constexpr_unsized_array_indexed : Note< |