aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2021-11-11 12:55:45 -0800
committerErich Keane <erich.keane@intel.com>2021-11-29 06:08:16 -0800
commit90010c2e1d60c6a9a4a0b30a113d4dae2b7214eb (patch)
tree99f55c053caff069172cf324eb14cff9a07718e7 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
parent5e96553608a1bbf688f11c76890dc543c5f89c61 (diff)
downloadllvm-90010c2e1d60c6a9a4a0b30a113d4dae2b7214eb.zip
llvm-90010c2e1d60c6a9a4a0b30a113d4dae2b7214eb.tar.gz
llvm-90010c2e1d60c6a9a4a0b30a113d4dae2b7214eb.tar.bz2
Don't consider 'LinkageSpec' when calculating DeclContext 'Encloses'
We don't properly handle lookup through using directives when there is a linkage spec in the common chain. This is because `CppLookupName` and `CppNamespaceLookup` end up skipping `LinkageSpec`'s (correctly, as they are not lookup scopes), but the `UnqualUsingDirectiveSet` does not. I discovered that when we are calculating the `CommonAncestor` for a using-directive, we were coming up with the `LinkageSpec`, instead of the `LinkageSpec`'s parent. Then, when we use `UnqualUsingDirectiveSet::getNamespacesFor` a scope, we don't end up finding any that were in the `LinkageSpec` (again, since `CppLookupName` skips linkage specs), so those don't end up participating in the lookup. The function `UnqualUsingDirectiveSet::addUsingDirective` calculates this common ancestor via a loop through the the `DeclSpec::Encloses` function. Changing this Encloses function to believe that a `LinkageSpec` `Encloses` nothing ends up fixing the problem without breaking any other tests, so I opted to do that. A less aggressive patch could perhaps change only the `addUsingDirective`, but my examination of all uses of `Encloses` showed that it seems to be used exclusively in lookup, which makes me think this is correct everywhere. Differential Revision: https://reviews.llvm.org/D113709
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h')
0 files changed, 0 insertions, 0 deletions