[PATCH] D60573: [Sema] ADL: Associated namespaces for class types and enumeration types (CWG 1691)

Bruno Ricci via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 11 11:50:45 PDT 2019


riccibruno created this revision.
riccibruno added reviewers: rjmccall, Quuxplusone.
riccibruno added a project: clang.
Herald added a subscriber: cfe-commits.
riccibruno added a parent revision: D60570: [Sema] Add more tests for the behavior of argument-dependent name lookup.

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...)


Repository:
  rC Clang

https://reviews.llvm.org/D60573

Files:
  lib/Sema/SemaLookup.cpp
  test/CXX/basic/basic.lookup/basic.lookup.argdep/p2-associated-namespaces-classes.cpp
  test/CXX/drs/dr16xx.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60573.194726.patch
Type: text/x-patch
Size: 8391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190411/a77db89f/attachment.bin>


More information about the cfe-commits mailing list