[clang] [Clang] Instantiate functions from constant evaluation. (PR #205557)
Daniel M. Katz via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 18 13:56:15 PDT 2026
katzdm wrote:
> I would suggest that the "rule" be: We allow template instantiation during any evaluation which is mandated.
That sounds sane to me - thought due to the oddity of this case, I'd prefer to defer the change to narrowing conversions to a separate PR. Are you okay with that?
> I had seen compiler crashes due to running an inner constant evaluation (from template instantiation) within another constant evaluation, which I guess the code didn't expect.
Sorry! I forgot to mention, there _were_ some crashes that I could probably stand to do more careful analysis on. I think I know the ones that you mean; let me dig on those - especially since you mention re-entrance into the constant evaluator, which is an important use-case for reflection (but probably even with this PR).
> immediate instantiation
We spoke offline, and determined that the crux test-case that this related to was `SemaCXX/cxx2b-consteval-propagate.cpp`. I actually didn't dive much into this one, so let me do that now and find an explanation for the errors.
Thanks!
https://github.com/llvm/llvm-project/pull/205557
More information about the cfe-commits
mailing list