This is an archive of the discontinued LLVM Phabricator instance.

Properly instantiate a decltype in argument's default initializer
Needs ReviewPublic

Authored by Mordante on Aug 3 2019, 2:10 AM.

Diff Detail

Event Timeline

Mordante created this revision.Aug 3 2019, 2:10 AM

This isn't the right approach: instead of re-instantiating the parameter when we encounter a use of it, we should inject the parameters into the local instantiation scope before trying to instantiate a default argument (Sema::CheckCXXDefaultArgExpr should call addInstantiatedParametersToScope to populate the LocalInstantiationScope before calling SubstInitializer).

Mordante updated this revision to Diff 218256.Sep 1 2019, 5:00 AM

Changed the approach to use addInstantiatedParametersToScope as suggested by @rsmith. Since the function was static in another file I made it a member of LocalInstantiationScope and adjusted all callers.

Minor changes:

  • Unit test remove link to Bugzilla
  • MutiLevelArgList -> MultiLevelArgList
comex added a comment.Sep 16 2019, 5:11 PM

Ping. I'm not qualified to review this myself but I'd like to see the bug fixed. :)

Friendly ping.