diff options
| author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-04-06 20:56:03 +0000 |
|---|---|---|
| committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-04-06 20:56:03 +0000 |
| commit | 71eafded8950b40f1c0a617b74724450d9cabc71 (patch) | |
| tree | 0b30e83c1bc95623e37f2401a4d8cddd9ae41c74 /clang/lib/AST | |
| parent | 1951cf24a789119d500f1e5f042b309cb70c3958 (diff) | |
| download | bcm5719-llvm-71eafded8950b40f1c0a617b74724450d9cabc71.tar.gz bcm5719-llvm-71eafded8950b40f1c0a617b74724450d9cabc71.zip | |
[modules] Don't try to add lookup results to non-lookup contexts.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27186
Patch reviewed by Richard Smith.
llvm-svn: 265597
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/DeclBase.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 5ec05a6604b..2722b82ef12 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -1559,9 +1559,12 @@ void DeclContext::makeDeclVisibleInContextWithFlags(NamedDecl *D, bool Internal, bool Recoverable) { assert(this == getPrimaryContext() && "expected a primary DC"); - // Skip declarations within functions. - if (isFunctionOrMethod()) + if (!isLookupContext()) { + if (isTransparentContext()) + getParent()->getPrimaryContext() + ->makeDeclVisibleInContextWithFlags(D, Internal, Recoverable); return; + } // Skip declarations which should be invisible to name lookup. if (shouldBeHidden(D)) |

