[cfe-commits] Possible fix for PR9685

David Blaikie dblaikie at gmail.com
Mon Oct 17 22:45:26 PDT 2011


I'll be the first to admit I'm not entirely confident that this fix is the
right one - but at the very least it's a starting point. It fixes the bug
and doesn't regress any other clang tests.

If there are things this change breaks, I'll be happy to add tests for those
cases & work on a fix that accommodates them, or if there's just a more
appropriate way to express the required semantics, I'm all ears.

[basically, members of local structs were being instantiated in the context
of their reference, not their definition, and failing because the Decl
corresponding to the template of the member wasn't in the context of the
instantiation scope (forEach in the attached example). By extending the
lifetime of the LocalInstantiationScope and walking up past uncombined
scopes in LocalInstantiationScope::findInstantiationOf it's now able to find
the relevant Decl & instantiate correctly]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111017/85933a4c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr9685.diff
Type: text/x-patch
Size: 1758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111017/85933a4c/attachment.bin>


More information about the cfe-commits mailing list