[all-commits] [llvm/llvm-project] 5a1c50: [clang] fix constexpr code generation for user con...
Matheus Izvekov via All-commits
all-commits at lists.llvm.org
Thu Jul 8 11:23:35 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5a1c50410ccc1973a1a0a4acca0c01677c28e9b6
https://github.com/llvm/llvm-project/commit/5a1c50410ccc1973a1a0a4acca0c01677c28e9b6
Author: Matheus Izvekov <mizvekov at gmail.com>
Date: 2021-07-08 (Thu, 08 Jul 2021)
Changed paths:
M clang/lib/AST/Expr.cpp
M clang/lib/Sema/SemaExprCXX.cpp
M clang/test/CodeGenCXX/cxx2a-consteval.cpp
Log Message:
-----------
[clang] fix constexpr code generation for user conversions.
When building the member call to a user conversion function during an
implicit cast, the expression was not being checked for immediate
invocation, so we were never adding the ConstantExpr node to AST.
This would cause the call to the user conversion operator to be emitted
even if it was constantexpr evaluated, and this would even trip an
assert when said user conversion was declared consteval:
`Assertion failed: !cast<FunctionDecl>(GD.getDecl())->isConsteval() && "consteval function should never be emitted", file clang\lib\CodeGen\CodeGenModule.cpp, line 3530`
Fixes PR48855.
Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D105446
More information about the All-commits
mailing list