OSDN Git Service

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)
committerTom Stellard <tstellar@redhat.com>
Sat, 13 Feb 2021 00:22:33 +0000 (16:22 -0800)
commit04cb6b5ea8bd2b52e3d11f4cb970fd2d144eee6a
treeddb39a571c47ba4933b3ed0a032ff955d8fa1a3b
parent6604c3050948d602ef24b3d3efbf9f4410494833
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.

(cherry picked from commit c945dc4a5023d6a17d11fcda76509b94b36e34fc)
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGenCXX/builtin-is-constant-evaluated.cpp