diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 91cbb9039dd8..f1406be74383 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-02-17 Alexandre Oliva + + PR c++/20022 + * semantics.c (perform_deferred_access_checks): Use + get_deferred_access_checks to get the top of the stack. + 2005-02-15 Alexandre Oliva PR c++/17788 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ebc213d7812c..fcffb3ddfa66 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -285,8 +285,7 @@ perform_deferred_access_checks (void) { tree deferred_check; - for (deferred_check = (VEC_last (deferred_access, deferred_access_stack) - ->deferred_access_checks); + for (deferred_check = get_deferred_access_checks (); deferred_check; deferred_check = TREE_CHAIN (deferred_check)) /* Check access. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7b678a37dfe7..4d58a1082335 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-02-17 Alexandre Oliva + + PR c++/20022 + * g++.dg/other/access3.C: New. + 2005-02-17 Ira Rosen * gcc.dg/vect/vect-98.c: New test. diff --git a/gcc/testsuite/g++.dg/other/access3.C b/gcc/testsuite/g++.dg/other/access3.C new file mode 100644 index 000000000000..2c21c1e5fa9e --- /dev/null +++ b/gcc/testsuite/g++.dg/other/access3.C @@ -0,0 +1,13 @@ +// { dg-do compile } +// { dg-options "-fno-access-control" } + +// PR c++/20022 + +// Make sure -fno-access-control doesn't crash, and actually grants at +// least some access. + +class B { + enum A {}; +}; + +B::A r;