diff options
author | John McCall <rjmccall@apple.com> | 2010-02-10 09:31:12 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-02-10 09:31:12 +0000 |
commit | 5b0829a321d56fe8349e3226efa66355d423c9e2 (patch) | |
tree | 3339769f5a12bf179bd769d85391d8cd9cbaec87 /clang/lib/Sema/SemaExceptionSpec.cpp | |
parent | f22553a1c713f7cc7eb1d249d16f85fe0e606b9e (diff) | |
download | bcm5719-llvm-5b0829a321d56fe8349e3226efa66355d423c9e2.tar.gz bcm5719-llvm-5b0829a321d56fe8349e3226efa66355d423c9e2.zip |
Improve access control diagnostics. Perform access control on member-pointer
conversions. Fix an access-control bug where privileges were not considered
at intermediate points along the inheritance path. Prepare for friends.
llvm-svn: 95775
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 7e2a98d0bf1..d0718d020b2 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -232,8 +232,22 @@ bool Sema::CheckExceptionSpecSubset( if (Paths.isAmbiguous(CanonicalSuperT)) continue; - if (FindInaccessibleBase(CanonicalSubT, CanonicalSuperT, Paths, true)) - continue; + // Do this check from a context without privileges. + switch (CheckBaseClassAccess(SourceLocation(), false, + CanonicalSuperT, CanonicalSubT, + Paths.front(), + /*ForceCheck*/ true, + /*ForceUnprivileged*/ true, + ADK_quiet)) { + case AR_accessible: break; + case AR_inaccessible: continue; + case AR_dependent: + llvm_unreachable("access check dependent for unprivileged context"); + break; + case AR_delayed: + llvm_unreachable("access check delayed in non-declaration"); + break; + } Contained = true; break; |