aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index b489460..66c892b 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -257,18 +257,19 @@ perform_or_defer_access_check (tree binfo, tree decl)
{
tree check;
- my_friendly_assert (TREE_CODE (binfo) == TREE_VEC, 20030623);
+ /* Exit if we are in a context that no access checking is performed. */
+ if (deferred_access_stack->deferring_access_checks_kind == dk_no_check)
+ return;
+ my_friendly_assert (TREE_CODE (binfo) == TREE_VEC, 20030623);
+
/* If we are not supposed to defer access checks, just check now. */
if (deferred_access_stack->deferring_access_checks_kind == dk_no_deferred)
{
enforce_access (binfo, decl);
return;
}
- /* Exit if we are in a context that no access checking is performed. */
- else if (deferred_access_stack->deferring_access_checks_kind == dk_no_check)
- return;
-
+
/* See if we are already going to perform this check. */
for (check = deferred_access_stack->deferred_access_checks;
check;