Fix line/file info for methods added by using declarations

This commit is contained in:
William S Fulton 2022-02-26 20:07:58 +00:00
commit 961424a986
3 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,9 @@
%module xxx
struct Base {
void m(bool) {}
};
struct Derived : Base {
void m(bool) const {}
using Base::m;
};

View file

@ -0,0 +1,2 @@
cpp_using_declaration_overload.i:7: Warning 512: Overloaded method Derived::m(bool) const ignored,
cpp_using_declaration_overload.i:8: Warning 512: using non-const method m(bool) instead.

View file

@ -1074,6 +1074,8 @@ class TypePass:private Dispatcher {
}
}
Node *nn = copyNode(c);
Setfile(nn, Getfile(n));
Setline(nn, Getline(n));
Delattr(nn, "access"); // access might be different from the method in the base class
Setattr(nn, "access", Getattr(n, "access"));
if (!Getattr(nn, "sym:name"))