From 2a5d14898a070435790310c1e51e73f955c5c4e2 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 2 Dec 2011 20:08:44 +0000 Subject: Make sure that name lookup in C checks whether a name is hidden. llvm-svn: 145700 --- clang/lib/Sema/SemaLookup.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Sema/SemaLookup.cpp') diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 5964d7232a8..c232515ef36 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -1123,6 +1123,11 @@ bool Sema::LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation) { !isa(*I)) continue; + // If this declaration is module-private and it came from an AST + // file, we can't see it. + if ((*I)->isModulePrivate() && (*I)->isFromASTFile()) + continue; + R.addDecl(*I); if ((*I)->getAttr()) { -- cgit v1.2.3