diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-10 23:44:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-10 23:44:35 +0000 |
commit | 2259d85a43e023daf3ba4afc88693766d5dfd5cc (patch) | |
tree | 51423bea98d11a0c000aeae8dcede2f294431c6d /clang/lib/Sema/SemaAccess.cpp | |
parent | de7ab801cce0a4e60b75f5cd9738f3f7e722db08 (diff) | |
download | bcm5719-llvm-2259d85a43e023daf3ba4afc88693766d5dfd5cc.tar.gz bcm5719-llvm-2259d85a43e023daf3ba4afc88693766d5dfd5cc.zip |
Don't crash in Sema::IsSimplyAccessible if the declaration is not a C++ class member. Fixes PR11108.
llvm-svn: 141600
Diffstat (limited to 'clang/lib/Sema/SemaAccess.cpp')
-rw-r--r-- | clang/lib/Sema/SemaAccess.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaAccess.cpp b/clang/lib/Sema/SemaAccess.cpp index d322ebd4100..6cd92303268 100644 --- a/clang/lib/Sema/SemaAccess.cpp +++ b/clang/lib/Sema/SemaAccess.cpp @@ -1652,7 +1652,7 @@ void Sema::CheckLookupAccess(const LookupResult &R) { /// \param Class the class/context from which to start the search /// \return true if the Decl is accessible from the Class, false otherwise. bool Sema::IsSimplyAccessible(NamedDecl *Decl, CXXRecordDecl *Class) { - if (!Class) + if (!Class || !Decl->isCXXClassMember()) return true; QualType qType = Class->getTypeForDecl()->getCanonicalTypeInternal(); |