From fb6563bf89bc135a6be2980aad2d68bb11424490 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Fri, 26 Dec 2003 03:20:20 +0000 Subject: [PATCH] backport: re PR c++/12862 (Conflicts Between typedefs/enums and Namespace Member Declarations) Backport from mainline: 2003-12-22 Mark Mitchell PR C++/12862 * decl.c (pushdecl): Look up all namespace-scope entities in their corresponding namespace. From-SVN: r75031 --- gcc/cp/ChangeLog | 9 +++++++++ gcc/cp/decl.c | 3 +-- gcc/testsuite/g++.dg/lookup/ns1.C | 7 ++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a8cc0cd17d2f..e504ea4f8f4f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2003-12-26 Gabriel Dos Reis + + Backport from mainline: + 2003-12-22 Mark Mitchell + + PR C++/12862 + * decl.c (pushdecl): Look up all namespace-scope entities in their + corresponding namespace. + 2003-12-22 Andrew Pinski PR c++/5050 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 03b90083696d..697b195cd8ae 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -4127,8 +4127,7 @@ pushdecl (x) /* In case this decl was explicitly namespace-qualified, look it up in its namespace context. */ - if (TREE_CODE (x) == VAR_DECL && DECL_NAMESPACE_SCOPE_P (x) - && namespace_bindings_p ()) + if (DECL_NAMESPACE_SCOPE_P (x) && namespace_bindings_p ()) t = namespace_binding (name, DECL_CONTEXT (x)); else t = lookup_name_current_level (name); diff --git a/gcc/testsuite/g++.dg/lookup/ns1.C b/gcc/testsuite/g++.dg/lookup/ns1.C index feeaf751cadd..c4fa5bc9c319 100644 --- a/gcc/testsuite/g++.dg/lookup/ns1.C +++ b/gcc/testsuite/g++.dg/lookup/ns1.C @@ -4,15 +4,12 @@ typedef int Thingo; namespace A { - void - Thingo(); + void Thingo(); } void A::Thingo() -{ - ; -} +{ } int main() -- 2.47.2