<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 20, 2020 at 11:36 PM jim x via Std-Discussion &lt;<a href="mailto:std-discussion@lists.isocpp.org">std-discussion@lists.isocpp.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,  everyone. please consider the below code:<br>
<br>
````<br>
template&lt;typename T&gt;<br>
void func(){<br>
struct Test{};<br>
show(Test{});<br>
}<br>
void show(...){<br>
}<br>
int main(){<br>
func&lt;int&gt;();<br>
}<br>
````<br>
There is no any rule in [temp.dep.type] to specify the local class<br>
declared within function template may be considered as dependent type.<br>
So, I think the name lookup for `show` should be bound at the point it<br>
is used. The second phase name lookup shouldn&#39;t occur due to `show` is<br>
not a dependent-name, at least according to the definition of<br>
dependent-name in section [temp.dep]. However, current implementations<br>
all consider `show` as a dependent-name which will be found by ADL in<br>
the context of instantiation, that is, The local class `Test` is<br>
viewed as dependent-type. If I don&#39;t misunderstand the section<br>
[temp.dep.type], how would `Test` be a dependent-type? For such a<br>
local class, Is it  a case  missed in the section [temp.dep.type].<br>
Thanks for discussing such an example.<br>
-- <br>
Std-Discussion mailing list<br>
<a href="mailto:Std-Discussion@lists.isocpp.org" target="_blank">Std-Discussion@lists.isocpp.org</a><br>
<a href="https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion" rel="noreferrer" target="_blank">https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion</a><br></blockquote><div><br></div><div>I agree that the current wording does not make &quot;Test&quot; a dependent type in your example. GCC/Clang/MSVC violate
<a href="https://timsong-cpp.github.io/cppwp/temp.res#10">[temp.res]/10</a> by failing to give an undeclared-identifier error for &quot;show&quot;.</div><div><br></div><div>But maybe that&#39;s intentional, and it&#39;s the wording that needs to be changed. If nested classes in class templates are dependent, why not also local classes in function templates?<br></div></div></div>

