This is an archive of the discontinued LLVM Phabricator instance.

Recover from missing 'typename' in sizeof(T::InnerType)
ClosedPublic

Authored by rnk on Jun 11 2014, 6:08 PM.

Details

Summary

'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or
an expression. This change threads a RecoveryTSI parameter through the
layers between TransformUnaryExprOrTypeTrait the point at which we look
up the type. If lookup finds a single type result after instantiation,
we now build TypeSourceInfo for it just like a normal transformation
would.

This fixes the last error in the hello world ATL app that I've been
working with, and it now links and runs with clang. Please try it and
file bugs!

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 10341.Jun 11 2014, 6:08 PM
rnk retitled this revision from to Recover from missing 'typename' in sizeof(T::InnerType).
rnk updated this object.
rnk added a reviewer: rsmith.
rnk added a subscriber: Unknown Object (MLST).
rsmith accepted this revision.Jun 12 2014, 3:34 PM
rsmith edited edge metadata.

Looks good.

lib/Sema/TreeTransform.h
6871 ↗(On Diff #10341)

It's sufficient to only test DRE here (you could also move the declaration of DRE into the if).

8282 ↗(On Diff #10341)

My over-80-column sense is tingling...

This revision is now accepted and ready to land.Jun 12 2014, 3:34 PM
rnk added a comment.Jun 12 2014, 4:11 PM

Thanks!

lib/Sema/TreeTransform.h
6871 ↗(On Diff #10341)

OK

8282 ↗(On Diff #10341)

yeah

rnk closed this revision.Jun 12 2014, 4:11 PM
rnk updated this revision to Diff 10373.

Closed by commit rL210855 (authored by @rnk).