[Clang][Sema] Do not evaluate value-dependent immediate invocations
authorEvgeny Shulgin <izaronplatz@gmail.com>
Fri, 25 Feb 2022 15:55:08 +0000 (16:55 +0100)
committerCorentin Jabot <corentinjabot@gmail.com>
Fri, 25 Feb 2022 16:23:36 +0000 (17:23 +0100)
commitc5e1b5e6a99f1ab78dafb54262d8f1fff998cb26
treead122eb50770f44f6da98ef39001eb0f53246621
parente109ce91b8b47fc34fb1301d89b1b8c04b27616b
[Clang][Sema] Do not evaluate value-dependent immediate invocations

Value-dependent ConstantExprs are not meant to be evaluated.
There is an assert in Expr::EvaluateAsConstantExpr that ensures this condition.
But before this patch the method was called without prior check.

Fixes https://github.com/llvm/llvm-project/issues/52768

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D119375
clang/lib/Sema/SemaExpr.cpp
clang/test/SemaCXX/cxx2a-consteval.cpp