CWG 1691 changed the definition of the namespaces associated with a class type or enumeration type.
For a class type, the associated namespaces are the innermost enclosing namespaces of the associated classes.
For an enumeration type, the associated namespace is the innermost enclosing namespace of its declaration.
This also fixes CWG 1690 and CWG 1692.
I have applied the fix to all language versions, even though I think that the DR only applies to C++14. The reason for this is that it is possible to return a local type from a lambda in C++11, and I don't think that this will affect anyone (although this can totally be a failure of my imagination...)