This is an archive of the discontinued LLVM Phabricator instance.

Prevent immediate evaluations inside of decltype
AbandonedPublic

Authored by wchilders on Mar 24 2020, 12:24 PM.

Details

Reviewers
Tyker
rsmith
Summary

This fixes an issue where immediate invocations were queued inside of decltype, resulting in decltype's operand being evaluated.

Diff Detail

Event Timeline

wchilders created this revision.Mar 24 2020, 12:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2020, 12:24 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Tyker added inline comments.Mar 25 2020, 11:45 AM
clang/lib/Sema/SemaExpr.cpp
15389

the issue is seems more general than delctype. it applies to all unvealuated context (sizeof, alignof ...)

i think we should use Sema::isUnevaluatedContext() here.

wchilders abandoned this revision.Mar 26 2020, 7:35 AM

Thanks Tyker, you're right, there is a general problem that needs handled, if this is to be handled; I had a bit of tunnel vision here. However, I'm retracting/abandoning this patch entirely as upon further review, it's not standard compliant. The current situation, is actually the correct one (for now?).

From [7.7.13] of the working draft:

Note: A manifestly constant-evaluated expression is evaluated even in an unevaluated operand.