aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-06-28 10:41:19 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2004-06-28 10:41:19 +0000
commit0f2a66c9c7ea9602a19ce1fa4a067c1c43e65363 (patch)
treecf4f78ec248da873e1e177db29f5cbdcd3a378fd /gcc/cp/semantics.c
parent58c42dc28354d5857a5d905d505127eb5624111f (diff)
downloadgcc-0f2a66c9c7ea9602a19ce1fa4a067c1c43e65363.zip
gcc-0f2a66c9c7ea9602a19ce1fa4a067c1c43e65363.tar.gz
gcc-0f2a66c9c7ea9602a19ce1fa4a067c1c43e65363.tar.bz2
friend.c (add_friend): Only perform access checks when context is a class.
* friend.c (add_friend): Only perform access checks when context is a class. * lex.c (cxx_make_type): Only create a binfo for aggregate types. * parser.c (cp_parser_class_specifier): Disable access checks here when parsing the body of a templated class. * semantics.c (perform_or_defer_access_checks): Reorder to allow NULL binfos when not checking access. From-SVN: r83771
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;