This is an archive of the discontinued LLVM Phabricator instance.

PR20716 - Crash when recovering from type in known dependent base (ms-compatibility)
ClosedPublic

Authored by nikola on Aug 20 2014, 5:19 PM.

Details

Reviewers
nlewycky
rnk
Summary

The call to cast crashes because getTemplateDecl returns null for TemplateTemplateParmDecls.

Diff Detail

Event Timeline

nikola updated this revision to Diff 12721.Aug 20 2014, 5:19 PM
nikola retitled this revision from to PR20716 - Crash when recovering from type in known dependent base (ms-compatibility) .
nikola updated this object.
nikola edited the test plan for this revision. (Show Details)
nikola added a reviewer: rnk.
nikola added a subscriber: Unknown Object (MLST).
nlewycky accepted this revision.Aug 20 2014, 5:50 PM
nlewycky added a reviewer: nlewycky.
nlewycky added a subscriber: nlewycky.

Looks good to Richard Smith.

This revision is now accepted and ready to land.Aug 20 2014, 5:50 PM
nikola updated this revision to Diff 12739.Aug 20 2014, 11:31 PM
nikola edited edge metadata.

We have to extend the check to cover type aliases as well. I've also updated the comment because TypeAliasDecl::Create never calls this constructor overload.

rnk accepted this revision.Aug 21 2014, 11:15 AM
rnk edited edge metadata.

Feel free to land with fixes.

lib/Sema/SemaDecl.cpp
155–156

I think this change can just be s/cast/dyn_cast_or_null/ and inserting "if (!BasePrimaryTemplate) continue;"

test/SemaTemplate/ms-lookup-template-base-classes.cpp
468–470

These 'foo' identifiers are getting delayed by ADL because they are function calls. I would try to use an unqualified name to try to declare a member, since I believe only a type can occur there.

nikola closed this revision.Aug 24 2014, 4:38 PM

Done in r216352.