From 43854f724a2bb2031e45626c43a9e6902c5639e8 Mon Sep 17 00:00:00 2001 From: Steven Bosscher Date: Tue, 12 Feb 2008 17:26:34 +0000 Subject: [PATCH] re PR c++/29048 ("`x' is private" error duplicated when scope specified) PR c++/29048 * semantics.c (finish_qualified_id_expr): Avoid duplicate access check here, too. From-SVN: r132261 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/semantics.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 943eef35de2..0fc1c1e3c28 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-02-12 Steven Bosscher + + PR c++/29048 + * semantics.c (finish_qualified_id_expr): Avoid duplicate access + check here, too. + 2008-02-12 Jakub Jelinek PR c++/34862 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 928975ad130..49dd80e1785 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1620,8 +1620,12 @@ finish_qualified_id_expr (tree qualifying_class, transformation, as there is no "this" pointer. */ ; else if (TREE_CODE (expr) == FIELD_DECL) - expr = finish_non_static_data_member (expr, current_class_ref, - qualifying_class); + { + push_deferring_access_checks (dk_no_check); + expr = finish_non_static_data_member (expr, current_class_ref, + qualifying_class); + pop_deferring_access_checks (); + } else if (BASELINK_P (expr) && !processing_template_decl) { tree fns;