summaryrefslogtreecommitdiff
path: root/gcc/cp/cxx-pretty-print.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-29 13:59:08 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-29 13:59:08 +0000
commit2108f7c0b436bbb66a9084654f9408482402004d (patch)
tree2cbe7215d3413ac50b94430f2f38d095f618b315 /gcc/cp/cxx-pretty-print.c
parent311b8117890b1a8a1788bab3cb565e8d887f78cd (diff)
downloadgcc-2108f7c0b436bbb66a9084654f9408482402004d.tar.gz
2010-09-29 Richard Guenther <rguenther@suse.de>
* tree.h (SCOPE_FILE_SCOPE_P): New macro. (DECL_FILE_SCOPE_P): Use it. (TYPE_FILE_SCOPE_P): New macro. cp/ * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P. (CP_TYPE_CONTEXT): Similar. (FROB_CONTEXT): Frob global_namespace to the global TRANSLATION_UNIT_DECL. * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL, set DECL_CONTEXT of global_namespace to it. (start_decl): Use CP_DECL_CONTEXT and test TYPE_P instead of zeroing context. (cp_finish_decl): Use DECL_FILE_SCOPE_P. (grokfndecl): Likewise. (start_preparsed_function): Likewise. * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P. (namespace_binding): Use SCOPE_FILE_SCOPE_P. * pt.c (template_class_depth): Use CP_TYPE_CONTEXT. (is_specialization_of_friend): Use CP_DECL_CONTEXT. (push_template_decl_real): Likewise. (tsubst_friend_class): Likewise. Adjust context comparisons. (instantiate_class_template): Use CP_TYPE_CONTEXT. (tsubst): Do not substitute into TRANSLATION_UNIT_DECL. * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use SCOPE_FILE_SCOPE_P. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164719 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cxx-pretty-print.c')
-rw-r--r--gcc/cp/cxx-pretty-print.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 24e282475cb..c3701c24432 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -260,7 +260,7 @@ pp_cxx_template_keyword_if_needed (cxx_pretty_printer *pp, tree scope, tree t)
static void
pp_cxx_nested_name_specifier (cxx_pretty_printer *pp, tree t)
{
- if (t != NULL && t != pp->enclosing_scope)
+ if (!SCOPE_FILE_SCOPE_P (t) && t != pp->enclosing_scope)
{
tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t);
pp_cxx_nested_name_specifier (pp, scope);