diff --git a/gcc/testsuite/g++.dg/lookup/using.C b/gcc/testsuite/g++.dg/lookup/using.C new file mode 100644 index 00000000000..2189d98f45b --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using.C @@ -0,0 +1,23 @@ +// { dg-do compile } + +struct X { }; +struct Y { }; +struct Z { }; + +struct Base { + X f() { return X(); } + Y f() const { return Y(); } +}; + +struct Derived : Base { + using Base::f; + Z f(int) { return Z(); } +}; + +int main() +{ + Derived d; + X x = d.f(); +} + +