-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
index is not an integer constant expression when using const fn argument #29798
Copy link
Copy link
Closed
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Type
Fields
Give feedbackNo fields configured for issues without a type.
I guess we cannot const evaluate the index anymore but must translate it with llvm's constant evaluator, because it might only be available as a value we got from a static. But then I'm not sure how to do the range check.Nope, that's not a problem. Is there any reason not to thin out trans/consts down to the point where it's just a thin wrapper around const_eval + translation of
ConstValtoValueRef?I mean after #25570 (const indexing), since after that I think the const_eval is feature-equivalent with the const translator.