This is an archive of the discontinued LLVM Phabricator instance.

[coroutines][PR41909] don't build dependent coroutine statements if the coroutine still has a dependent promise type
AbandonedPublic

Authored by blastrock on Dec 16 2019, 5:42 AM.

Details

Summary

This started with bug https://bugs.llvm.org/show_bug.cgi?id=41909 which was fixed by https://reviews.llvm.org/D62550 . In the last comment of the bug report, Pavel A. Lebedev gives a code snippet that now makes clang trigger an ICE. This code was broken by that very commit.

I am no expert, but I tried to follow this comment. We now build the dependent statements only if the promise type is not dependent anymore. If it still is, I guess dependent statements are built in a later pass when all templates are instantiated.

I have added the second code snippet from the bug and the godbolt snippet from modocache's answer on the review, this patch seems to fix them all.

Diff Detail

Event Timeline

blastrock created this revision.Dec 16 2019, 5:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2019, 5:42 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
blastrock edited the summary of this revision. (Show Details)Dec 16 2019, 5:43 AM
modocache requested changes to this revision.Dec 18 2019, 9:47 AM

Great minds think alike! This looks like the patch I sent in November, D70579. I only just committed it two days ago in rG376cf43, but I ought to have updated the bug report. Thanks for pointing this out!

Unfortunately we duplicated some work here, and so I'm not sure this patch is needed.

This revision now requires changes to proceed.Dec 18 2019, 9:47 AM
blastrock abandoned this revision.Dec 18 2019, 10:06 AM

Indeed, I'm closing this then, I haven't tested your patch yet but the fix seems to be the exact same. You seem to have a better idea of what you are doing and your patch reflects that ^^

Thanks for the fix!