https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117174
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Hmm, I just tried the example in DR 1321 (https://cplusplus.github.io/CWG/issues/1321.html) that is not supposed to compile and it does compile using the wrong lookup. That is: ``` template <class T> decltype(g(T())) h(); int g(int); template <class T> decltype(g(T())) h() // redeclaration of h() uses the earlier lookup { return g(T()); } // ...although the lookup here does find g(int) int i = h<int>(); // template argument substitution fails; g(int) // was not in scope at the first declaration of h() ``` So at least clang does not implement the resolution of this DR. Though in our case we use the hashtable for unrelated lookups things too much.