diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/overload/defarg2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/overload/defarg2.C | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/overload/defarg2.C b/gcc/testsuite/g++.dg/overload/defarg2.C new file mode 100644 index 000000000..d8ecb2fa7 --- /dev/null +++ b/gcc/testsuite/g++.dg/overload/defarg2.C @@ -0,0 +1,17 @@ +// PR c++/37971 +// { dg-do compile } + +class C { +private: + static int f(int); + static int f(char); + +public: + static void g(int (*)(int) = f); +}; + +void h() { + /* Although C::f is inaccessible here, it is accessible in the + context of C::g, so there is no error. */ + C::g(); +} |