This is an archive of the discontinued LLVM Phabricator instance.

Give up on evaluating value-dependent potential constexpr before hitting the assertion.
Needs ReviewPublic

Authored by adamcz on Nov 10 2020, 7:02 AM.

Details

Reviewers
rsmith
hokein
Summary

This addresses a new type of assert() crash since
f7f2e4261a98b2da519d58e7f6794b013cda7a4b.

EvaluateInPlace assumes it's never called on value-dependent expression,
but it is possible for this to happen when inside CallExpr and errors
were encountered earlier.

Diff Detail

Event Timeline

adamcz created this revision.Nov 10 2020, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 10 2020, 7:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
adamcz requested review of this revision.Nov 10 2020, 7:02 AM
adamcz updated this revision to Diff 305818.Nov 17 2020, 9:06 AM

Added [clang] in commit description

oops, this reminds me of the patch https://reviews.llvm.org/D84637 (I should have landed it, sorry), that patch should fix a general recovery-expr crash inside constexpr function body. I think the crash test should be fixed by that (let me check tomorrow).

oops, this reminds me of the patch https://reviews.llvm.org/D84637 (I should have landed it, sorry), that patch should fix a general recovery-expr crash inside constexpr function body. I think the crash test should be fixed by that (let me check tomorrow).

yeah, confirmed that D84637 will fix the crash, I also added the crash case there.