This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug debug/37890] Incorrect nesting for DW_TAG_imported_declaration



------- Comment #7 from jakub at gcc dot gnu dot org  2009-03-20 12:47 -------
Created an attachment (id=17502)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17502&action=view)
gcc44-pr37890.patch

Testcase with more namespace aliases:

namespace A
{
  int x = 1;
}

namespace B1 = A;
namespace B2 = B1;
namespace E
{
  namespace E1 = A;
  int y = E1::x;
}

void
foo ()
{
  namespace C1 = A;
  namespace C2 = B1;
  namespace C3 = C1;
  B1::x++;
  B2::x++;
  C1::x++;
  C2::x++;
  C3::x++;
  {
    namespace D1 = A;
    namespace D2 = B2;
    namespace D3 = C3;
    namespace D4 = E::E1;
    D1::x++;
    D2::x++;
    D3::x++;
    D4::x++;
    E::E1::x++;
  }
}

template <int N>
void
bar ()
{
  namespace C1 = A;
  namespace C2 = B1;
  namespace C3 = C1;
  B1::x++;
  B2::x++;
  C1::x++;
  C2::x++;
  C3::x++;
  {
    namespace D1 = A;
    namespace D2 = B2;
    namespace D3 = C3;
    namespace D4 = E::E1;
    D1::x++;
    D2::x++;
    D3::x++;
    D4::x++;
    E::E1::x++;
  }
}

int
main ()
{
  foo ();
  bar<0> ();
  bar<6> ();
}

For some reason the bar<0> and bar<6> templates are emitted as DW_AT_external
with no lexical blocks etc., but I guess that's unrelated to this bug.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37890


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]