This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-04-13
[Voted into the WP at the March, 2011 meeting as part of paper N3262.]
6.5.4 [basic.lookup.argdep] paragraph 2 excludes dependent parametertypes and return types from consideration in determining the associatedclasses and namespaces of a function template. Presumably this meansthat an example like
namespace N { template<class T> struct A { }; void f(void (*)()); } template <class T> void g(T, N::A<T>); void g(); int main() { f(g); }
is ill-formed because the second parameter of the function templateg does not add namespaceN to the list of associatednamespaces. This was probably unintentional.
See alsoissue 1015.
Notes from the November, 2010 meeting:
The CWG agreed that the rules should be changed to make thisexample well-formed.
Proposed resolution (November, 2010) [SUPERSEDED]:
Change 6.5.4 [basic.lookup.argdep] paragraph 2 as follows:
...In addition, if the argument is the name or address of a set ofoverloaded functions and/or function templates, its associated classesand namespaces are the union of those associated with each of themembers of the set, i.e., the classes and namespaces associated withits(non-dependent)parameter types and return type.Additionally, if the aforementioned set of overloaded functionsis named with atemplate-id, its associated classesand namespaces are those of its typetemplate-arguments and its templatetemplate-arguments.
This resolution also resolvesissue 1015.
[Drafting note: It's not clear that we need the inserted textabove, because for the example inissue 1015, the typeN::S is already represented in thetype of the function address, so there is no need to pull it fromtemplate arguments. For cases where template parameters are notrepresented in the function type, it's not clear that we want ADL toreach further.]