[namespace.alias]

# 9 Declarations [[dcl]](./#dcl)

## 9.9 Namespaces [[basic.namespace]](basic.namespace#namespace.alias)

### 9.9.3 Namespace alias [namespace.alias]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/declarations.tex#L8417)

A [*namespace-alias-definition*](#nt:namespace-alias-definition "9.9.3 Namespace alias [namespace.alias]") declares a [*namespace alias*](#def:alias,namespace "9.9.3 Namespace alias [namespace.alias]") according to the following grammar:

[namespace-alias:](#nt:namespace-alias "9.9.3 Namespace alias [namespace.alias]")  
[*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]")

[namespace-alias-definition:](#nt:namespace-alias-definition "9.9.3 Namespace alias [namespace.alias]")  
namespace [*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]") = [*qualified-namespace-specifier*](#nt:qualified-namespace-specifier "9.9.3 Namespace alias [namespace.alias]") ;  
namespace [*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]") = [*splice-specifier*](basic.splice#nt:splice-specifier "6.6 Splice specifiers [basic.splice]") ;  

[qualified-namespace-specifier:](#nt:qualified-namespace-specifier "9.9.3 Namespace alias [namespace.alias]")  
[*nested-name-specifier*](expr.prim.id.qual#nt:nested-name-specifier "7.5.5.3 Qualified names [expr.prim.id.qual]")opt [*namespace-name*](namespace.def.general#nt:namespace-name "9.9.2.1 General [namespace.def.general]")

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/declarations.tex#L8436)

The [*splice-specifier*](basic.splice#nt:splice-specifier "6.6 Splice specifiers [basic.splice]") (if any)
shall designate a namespace that is not the global namespace[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/declarations.tex#L8440)

The [*identifier*](lex.name#nt:identifier "5.11 Identifiers [lex.name]") in a [*namespace-alias-definition*](#nt:namespace-alias-definition "9.9.3 Namespace alias [namespace.alias]") becomes a [*namespace-alias*](#nt:namespace-alias "9.9.3 Namespace alias [namespace.alias]")[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/declarations.tex#L8444)

The underlying entity ([[basic.pre]](basic.pre "6.1 Preamble")) of the namespace alias is
the namespace either
denoted by the [*qualified-namespace-specifier*](#nt:qualified-namespace-specifier "9.9.3 Namespace alias [namespace.alias]") or
designated by the [*splice-specifier*](basic.splice#nt:splice-specifier "6.6 Splice specifiers [basic.splice]")[.](#4.sentence-1)

[*Note [1](#note-1)*:

When looking up a [*namespace-name*](namespace.def.general#nt:namespace-name "9.9.2.1 General [namespace.def.general]") in a[*namespace-alias-definition*](#nt:namespace-alias-definition "9.9.3 Namespace alias [namespace.alias]"), only namespace names are
considered, see [[basic.lookup.udir]](basic.lookup.udir "6.5.7 Using-directives and namespace aliases")[.](#4.sentence-2)

â *end note*]
