126a53354Schristos /* This testcase is part of GDB, the GNU debugger.
226a53354Schristos
3*1424dfb3Schristos Copyright 2011-2020 Free Software Foundation, Inc.
426a53354Schristos
526a53354Schristos This program is free software; you can redistribute it and/or modify
626a53354Schristos it under the terms of the GNU General Public License as published by
726a53354Schristos the Free Software Foundation; either version 3 of the License, or
826a53354Schristos (at your option) any later version.
926a53354Schristos
1026a53354Schristos This program is distributed in the hope that it will be useful,
1126a53354Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of
1226a53354Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1326a53354Schristos GNU General Public License for more details.
1426a53354Schristos
1526a53354Schristos You should have received a copy of the GNU General Public License
1626a53354Schristos along with this program. If not, see <http://www.gnu.org/licenses/>.
1726a53354Schristos
1826a53354Schristos Contributed by Red Hat, originally written by Keith Seitz. */
1926a53354Schristos
2026a53354Schristos #include <stdlib.h>
2126a53354Schristos
2226a53354Schristos namespace
2326a53354Schristos {
doit1(void)2426a53354Schristos void doit1 (void) { } // doit1(void)
doit1(int a)2526a53354Schristos void doit1 (int a) { } // doit1(int)
doit1(char * a)2626a53354Schristos void doit1 (char *a) { } // doit1(char *)
2726a53354Schristos
2826a53354Schristos class one
2926a53354Schristos {
3026a53354Schristos public:
one(void)3126a53354Schristos one (void) { } // one::one(void)
one(int a)3226a53354Schristos one (int a) { } // one::one(int)
one(char * a)3326a53354Schristos one (char *a) { } // one::one(char *)
doit(void)3426a53354Schristos static void doit (void) { } // one::doit(void)
3526a53354Schristos };
3626a53354Schristos
3726a53354Schristos namespace A
3826a53354Schristos {
doit2(void)3926a53354Schristos void doit2 (void) { } // A::doit2(void)
doit2(int a)4026a53354Schristos void doit2 (int a) { } // A::doit2(int)
doit2(char * a)4126a53354Schristos void doit2 (char *a) { } // A::doit2(char *)
4226a53354Schristos
4326a53354Schristos class two
4426a53354Schristos {
4526a53354Schristos public:
two(void)4626a53354Schristos two (void) { } // A::two::two(void)
two(int a)4726a53354Schristos two (int a) { } // A::two::two(int)
two(char * a)4826a53354Schristos two (char *a) { } // A::two::two(char *)
doit(void)4926a53354Schristos static void doit (void) { } // A::two::doit(void)
5026a53354Schristos };
5126a53354Schristos
5226a53354Schristos namespace
5326a53354Schristos {
5426a53354Schristos namespace
5526a53354Schristos {
doit3(void)5626a53354Schristos void doit3 (void) { } // A::doit3(void)
doit3(int a)5726a53354Schristos void doit3 (int a) { } // A::doit3(int)
doit3(char * a)5826a53354Schristos void doit3 (char *a) { } // A::doit3(char *)
5926a53354Schristos
6026a53354Schristos class three
6126a53354Schristos {
6226a53354Schristos public:
three(void)6326a53354Schristos three (void) { } // A::three::three(void)
three(int a)6426a53354Schristos three (int a) { } // A::three::three(int)
three(char * a)6526a53354Schristos three (char *a) { } // A::three::three(char *)
doit(void)6626a53354Schristos static void doit (void) { } // A::three::doit(void)
6726a53354Schristos };
6826a53354Schristos }
6926a53354Schristos }
7026a53354Schristos }
7126a53354Schristos }
7226a53354Schristos
7326a53354Schristos void
doit(void)7426a53354Schristos doit (void)
7526a53354Schristos {
7626a53354Schristos one a, b (3), c (static_cast<char *> (NULL));
7726a53354Schristos one::doit ();
7826a53354Schristos A::two d, e (3), f (static_cast<char *> (NULL));
7926a53354Schristos A::two::doit ();
8026a53354Schristos A::three g, h (3), i (static_cast<char *> (NULL));
8126a53354Schristos A::three::doit ();
8226a53354Schristos doit1 ();
8326a53354Schristos doit1 (3);
8426a53354Schristos doit1 (static_cast<char *> (NULL));
8526a53354Schristos A::doit2 ();
8626a53354Schristos A::doit2 (3);
8726a53354Schristos A::doit2 (static_cast<char *> (NULL));
8826a53354Schristos A::doit3 ();
8926a53354Schristos A::doit3 (3);
9026a53354Schristos A::doit3 (static_cast<char *> (NULL));
9126a53354Schristos }
92