https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109260

            Bug ID: 109260
           Summary: -fdump-ada-spec does not support C++ namespaces
           Product: gcc
           Version: 12.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mytbk920423 at gmail dot com
  Target Milestone: ---

For example, the following C++ code has three namespaces:

namespace test_ns
{
  namespace test_ns_1
  {
    struct A_Record { int x, y; };
  }

  namespace test_ns_2
  {
    struct A_Record { int x, y, z; };
  }
}

Using g++ -fdump-ada-spec generates the following package, which has
declaration conflicts:

package test_ns_hh is

   type A_Record is record
      x : aliased int;  -- test_ns.hh:5
      y : aliased int;  -- test_ns.hh:5
   end record
   with Convention => C_Pass_By_Copy;  -- test_ns.hh:5

   type A_Record is record
      x : aliased int;  -- test_ns.hh:10
      y : aliased int;  -- test_ns.hh:10
      z : aliased int;  -- test_ns.hh:10
   end record
   with Convention => C_Pass_By_Copy;  -- test_ns.hh:10

end test_ns_hh;

Reply via email to