]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/12862 (Conflicts Between typedefs/enums and Namespace Member...
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Fri, 26 Dec 2003 03:20:20 +0000 (03:20 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Fri, 26 Dec 2003 03:20:20 +0000 (03:20 +0000)
Backport from mainline:
2003-12-22  Mark Mitchell  <mark@codesourcery.com>

PR C++/12862
* decl.c (pushdecl): Look up all namespace-scope entities in
their
corresponding namespace.

From-SVN: r75031

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.dg/lookup/ns1.C

index a8cc0cd17d2f7c88fe078a5188470b472ef9481c..e504ea4f8f4f11236c825a9f8d351996201dd794 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-26  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       Backport from mainline:
+       2003-12-22  Mark Mitchell  <mark@codesourcery.com>
+
+       PR C++/12862
+       * decl.c (pushdecl): Look up all namespace-scope entities in their 
+       corresponding namespace.
+
 2003-12-22  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR c++/5050
index 03b90083696d5df7909ff10d7e9e5adb7ad87dcc..697b195cd8ae7f97ae05a0b02d97b19d7fc7e3c8 100644 (file)
@@ -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);
index feeaf751cadd35e6a1da0a22a56695c200b94ce0..c4fa5bc9c3197f00667adb86b56a7c7900e82d8e 100644 (file)
@@ -4,15 +4,12 @@ typedef int Thingo;
   
 namespace A
 {
-    void
-    Thingo();
+  void Thingo();
 }
   
 void
 A::Thingo()
-{
-  ;
-}
+{ }
   
 int
 main()