1 // testdoublens.hpp --- Header file used in one of the Semantic tests 2 3 // Copyright (C) 2008-2023 Free Software Foundation, Inc. 4 5 // Author: Eric M. Ludlam <zappo@gnu.org> 6 7 // This file is part of GNU Emacs. 8 9 // GNU Emacs is free software: you can redistribute it and/or modify 10 // it under the terms of the GNU General Public License as published by 11 // the Free Software Foundation, either version 3 of the License, or 12 // (at your option) any later version. 13 14 // GNU Emacs is distributed in the hope that it will be useful, 15 // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 // GNU General Public License for more details. 18 19 // You should have received a copy of the GNU General Public License 20 // along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 21 22 namespace Name1 { 23 namespace Name2 { 24 25 class Foo 26 { 27 typedef unsigned int Mumble; 28 public: 29 Foo(); 30 ~Foo(); 31 int get(); 32 33 private: 34 void publishStuff(char /* a */, char /* b */); 35 36 void publishStuff(int q, int r); // Purposely different names. 37 38 void sendStuff(int a, int b); 39 40 Mumble* pMumble; 41 }; 42 43 typedef Foo stage1_Foo; 44 45 } // namespace Name2 46 47 typedef Name2::stage1_Foo stage2_Foo; 48 49 typedef Name2::Foo decl_stage1_Foo; 50 51 } // namespace Name1 52 53 typedef Name1::stage2_Foo stage3_Foo; 54 55 56 // Double namespace from Hannu Koivisto 57 namespace a { 58 namespace b { 59 60 class Foo 61 { 62 struct Dum { 63 int diDum; 64 }; 65 66 protected: 67 mutable a::b::Foo::Dum dumdum; 68 }; 69 70 } // namespace b 71 } // namespace a