Test for invalid C++17 nested namespace aliases

This commit is contained in:
William S Fulton 2018-05-14 20:58:11 +01:00
commit aa6d7931ac
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,34 @@
%module cpp_nested_namespace_alias
// C++17 nested namespaces
namespace A
{
namespace B
{
void ab1();
}
}
namespace A::B
{
void ab2();
}
namespace AAlias = A;
namespace AAlias::B
{
void ab3();
}
namespace A
{
namespace BAlias = B;
void ab4();
}
namespace A::BAlias
{
void ab5();
}
namespace ABAlias = A::B;
namespace ABAlias
{
void ab6();
}

View file

@ -0,0 +1,3 @@
cpp_nested_namespace_alias.i:18: Warning 308: Namespace alias 'AAlias' not allowed here. Assuming 'A'
cpp_nested_namespace_alias.i:27: Warning 308: Namespace alias 'BAlias' not allowed here. Assuming 'B'
cpp_nested_namespace_alias.i:32: Warning 308: Namespace alias 'ABAlias' not allowed here. Assuming 'B'