* class.c (add_method): Do compare 'this' quals when trying to match a
used function. Don't defer to another used function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48982
138bc75d-0d04-0410-961f-
82ee72b054a4
--- /dev/null
+// Test that overloading on 'this' quals works with class using-declarations.
+
+// { dg-do link }
+
+struct A {
+ void f() const;
+ void f() {}
+ void g() const {}
+ void g();
+ void h() const;
+ void h();
+ void i() const;
+ void i() {}
+};
+
+struct B: private A {
+ using A::f;
+ using A::g;
+ void h () const {}
+ using A::h;
+ void i () const {}
+ using A::i;
+};
+
+int main()
+{
+ B b1;
+ const B b2 = B();
+
+ b1.f ();
+ b2.g ();
+ b2.h ();
+ b1.i ();
+}