PR48587: is_constant_evaluated() should not evaluate to true during a
authorRichard Smith <richard@metafoo.co.uk>
Tue, 9 Feb 2021 01:32:52 +0000 (17:32 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Tue, 9 Feb 2021 01:34:40 +0000 (17:34 -0800)
commitc945dc4a5023d6a17d11fcda76509b94b36e34fc
tree7665f37fe538d96ae12f09f886f7cc1d2d58a7d9
parent3e837e17357e2b0a64638e0f7c052b9f4f2f2d3d
PR48587: is_constant_evaluated() should not evaluate to true during a
variable's destruction if it didn't do so during construction.

The standard doesn't give any guidance as to what to do here, but this
approach seems reasonable and conservative, and has been proposed to the
standard committee.
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGenCXX/builtin-is-constant-evaluated.cpp