summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-05-23 03:43:44 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-05-23 03:43:44 +0000
commitefb1af9ae83fc28702b3b946fa05b3960f689d5c (patch)
tree65ba40b51909cb74660dee2b710d5dd316a082aa /clang/lib/Sema/SemaDeclCXX.cpp
parentbc90690b24bdbc7d6d2f795bb77038a6c14d6120 (diff)
downloadbcm5719-llvm-efb1af9ae83fc28702b3b946fa05b3960f689d5c.tar.gz
bcm5719-llvm-efb1af9ae83fc28702b3b946fa05b3960f689d5c.zip
Emulate a MSVC bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated.
Example: class A { public: int f(); }; class B : public A { private: using A::f; }; class C : public B { private: using B::f; }; Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it. This fixes 1 error when parsing MFC code with clang. llvm-svn: 131896
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 4fc9bf1fdd5..8bf7cb67b88 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -5345,6 +5345,7 @@ NamedDecl *Sema::BuildUsingDeclaration(Scope *S, AccessSpecifier AS,
// Otherwise, look up the target name.
LookupResult R(*this, NameInfo, LookupOrdinaryName);
+ R.setUsingDeclaration(true);
// Unlike most lookups, we don't always want to hide tag
// declarations: tag names are visible through the using declaration
OpenPOWER on IntegriCloud