148596154Schristos /* This testcase is part of GDB, the GNU debugger.
248596154Schristos 
3*1424dfb3Schristos    Copyright 2003-2020 Free Software Foundation, Inc.
448596154Schristos 
548596154Schristos    This program is free software; you can redistribute it and/or modify
648596154Schristos    it under the terms of the GNU General Public License as published by
748596154Schristos    the Free Software Foundation; either version 3 of the License, or
848596154Schristos    (at your option) any later version.
948596154Schristos 
1048596154Schristos    This program is distributed in the hope that it will be useful,
1148596154Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1248596154Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1348596154Schristos    GNU General Public License for more details.
1448596154Schristos 
1548596154Schristos    You should have received a copy of the GNU General Public License
167af5a897Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
1748596154Schristos 
1848596154Schristos class A
1948596154Schristos {
2048596154Schristos public:
2148596154Schristos   enum E {X,Y,Z};
2248596154Schristos };
2348596154Schristos 
2448596154Schristos class B1 : public A
2548596154Schristos {
2648596154Schristos };
2748596154Schristos 
2848596154Schristos class B2 : public A
2948596154Schristos {
3048596154Schristos };
3148596154Schristos 
3248596154Schristos class C : public B1, public B2
3348596154Schristos {
3448596154Schristos public:
3548596154Schristos   void test(E e);
3648596154Schristos };
3748596154Schristos 
test(E e)3848596154Schristos void C::test(E e)
3948596154Schristos {
4048596154Schristos   if (e == X)  // breakpoint 1
4148596154Schristos     {
4248596154Schristos     }
4348596154Schristos }
4448596154Schristos 
4548596154Schristos namespace N
4648596154Schristos {
4748596154Schristos   class A
4848596154Schristos   {
4948596154Schristos   public:
5048596154Schristos     enum E {X, Y, Z};
5148596154Schristos   };
5248596154Schristos 
5348596154Schristos   class B1 {};
5448596154Schristos   class B2 : public A {};
5548596154Schristos 
5648596154Schristos   class C : public B1, public B2
5748596154Schristos   {
5848596154Schristos   public:
5948596154Schristos     void test (E e);
6048596154Schristos   };
6148596154Schristos 
6248596154Schristos   void
test(E e)6348596154Schristos   C::test (E e)
6448596154Schristos   {
6548596154Schristos     if (e == X) // breakpoint 2
6648596154Schristos       {
6748596154Schristos       }
6848596154Schristos   }
6948596154Schristos }
7048596154Schristos 
main()7148596154Schristos int main()
7248596154Schristos {
7348596154Schristos   C c;
7448596154Schristos   c.test(A::X);
7548596154Schristos 
7648596154Schristos   N::C nc;
7748596154Schristos   nc.test (N::A::X);
7848596154Schristos   return 0;
7948596154Schristos }
8048596154Schristos 
81