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

            Bug ID: 88166
           Summary: Inconsistent placement of cv-quals and ptr-declarator
                    in debuginfo
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

Given:

struct any {

  enum Op { E };

  struct Arg { char c; };

  template<typename T>
    struct Manager
    {
      static void manage(Op, const any*, Arg*) { }
    };
};

int main()
{
  auto lambda = [](){};
  auto f1 = &any::Manager<int>::manage;
  auto f2 = &any::Manager<decltype(lambda)>::manage;
  return 0;
}

g++ -g any.cc
gdb -q -ex start -ex "n 2" -ex "p f1" -ex "p f2" -ex cont -ex q a.out
Reading symbols from a.out...done.
Temporary breakpoint 1 at 0x4004ab: file any.cc, line 15.
Starting program: /tmp/a.out 

Temporary breakpoint 1, main () at any.cc:15
15        auto f1 = &any::Manager<int>::manage;
17        return 0;
$1 = (void (*)(const any *, any::Arg *)) 0x4004d1
<any::Manager<int>::manage(any const*, any::Arg*)>
$2 = (void (*)(const any *, any::Arg *)) 0x4004c2
<any::Manager<main()::<lambda()> >::manage(const any *, any::Arg *)>
Continuing.
[Inferior 1 (process 29483) exited normally]

Note that the first function parameter-list is (any const*, any::Arg*) and the
second is (const any *, any::Arg *).

This breaks the python pretty printers for std::any (see Bug 87308).

Why the inconsistency?

Reply via email to