| 1 |
// Merge success |
| 2 |
namespace N1 { |
| 3 |
extern int x0; |
| 4 |
} |
| 5 |
|
| 6 |
// Merge multiple namespaces |
| 7 |
namespace N2 { |
| 8 |
extern int x; |
| 9 |
} |
| 10 |
namespace N2 { |
| 11 |
extern float y; |
| 12 |
} |
| 13 |
|
| 14 |
// Merge namespace with conflict |
| 15 |
namespace N3 { |
| 16 |
extern double z; |
| 17 |
} |
| 18 |
|
| 19 |
namespace Enclosing { |
| 20 |
namespace Nested { |
| 21 |
const int z = 4; |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
namespace ContainsInline { |
| 26 |
inline namespace Inline { |
| 27 |
const int z = 10; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
namespace TestAliasName = Enclosing::Nested; |
| 32 |
// NOTE: There is no warning on this alias. |
| 33 |
namespace AliasWithSameName = Enclosing::Nested; |
| 34 |
|
| 35 |
namespace TestUsingDecls { |
| 36 |
|
| 37 |
namespace A { |
| 38 |
void foo(); |
| 39 |
} |
| 40 |
namespace B { |
| 41 |
using A::foo; // <- a UsingDecl creating a UsingShadow |
| 42 |
} |
| 43 |
|
| 44 |
}// end namespace TestUsingDecls |
| 45 |
|
| 46 |
namespace TestUnresolvedTypenameAndValueDecls { |
| 47 |
|
| 48 |
template <class T> class Base; |
| 49 |
template <class T> class Derived : public Base<T> { |
| 50 |
public: |
| 51 |
using typename Base<T>::foo; |
| 52 |
using Base<T>::bar; |
| 53 |
typedef typename Derived::foo NewUnresolvedUsingType; |
| 54 |
}; |
| 55 |
|
| 56 |
} // end namespace TestUnresolvedTypenameAndValueDecls |
| 57 |
|
| 58 |
namespace TestUsingNamespace { |
| 59 |
using namespace Enclosing; |
| 60 |
} |