c++/24367: Infinite recursion of typedef substitution
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / namespace.cc
index 7b9a173d819b8b745d87c668cb58e66cee3ee4eb..f918b63de93804601bbb38d9abe8537d75a0912d 100644 (file)
@@ -8,6 +8,11 @@ namespace AAA {
     int xx;
     int fum (int);
   };
+  enum SomeEnum {
+    ALPHA,
+    BETA,
+    DELTA
+  };
 };
 
 int AAA::inA::fum (int i)
@@ -75,6 +80,11 @@ namespace
   namespace G
   {
     int Xg = 10;
+
+    namespace
+    {
+      int XgX = 11;
+    }
   }
 }
 
@@ -83,6 +93,22 @@ namespace C
   int c = 1;
   int shadow = 12;
 
+  class CClass {
+  public:
+    int x;
+    class NestedClass {
+    public:
+      int y;
+    };
+  };
+
+  void ensureRefs () {
+    // NOTE (2004-04-23, carlton): This function is here only to make
+    // sure that GCC 3.4 outputs debug info for these classes.
+    static CClass *c = new CClass();
+    static CClass::NestedClass *n = new CClass::NestedClass();
+  }
+
   namespace
   {
     int cX = 6;
@@ -90,6 +116,11 @@ namespace C
     namespace F
     {
       int cXf = 7;
+
+      namespace
+      {
+       int cXfX = 8;
+      }
     }
   }
 
@@ -98,6 +129,11 @@ namespace C
     int cc = 2;
   }
 
+  namespace E
+  {
+    int ce = 4;
+  }
+
   namespace D
   {
     int cd = 3;
@@ -118,14 +154,18 @@ namespace C
       //cc;
       C::cc;
       cd;
+      //C::D::cd;
       E::cde;
       shadow;
+      //E::ce;
       cX;
       F::cXf;
+      F::cXfX;
       X;
       G::Xg;
       //cXOtherFile;
       //XOtherFile;
+      G::XgX;
 
       return;
     }
@@ -133,10 +173,13 @@ namespace C
   }
 }
 
+extern int ensureOtherRefs ();
+
 int main ()
 {
   using AAA::inA;
   char c1;
+  AAA::SomeEnum var = AAA::ALPHA;
 
   using namespace BBB;
   
@@ -160,4 +203,7 @@ int main ()
   marker1();
   
   C::D::marker2 ();
+
+  C::ensureRefs ();
+  ensureOtherRefs ();
 }
This page took 0.02541 seconds and 4 git commands to generate.