diff options
Diffstat (limited to 'lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | lib/Sema/SemaExceptionSpec.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp index 7e2a98d0bf..d0718d020b 100644 --- a/lib/Sema/SemaExceptionSpec.cpp +++ b/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; |