<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><font face="Menlo, Consolas, Monaco, monospace" class=""><span style="background-color: rgba(151, 234, 151, 0.6);" class=""><br class=""></span></font><div>I would try replacing</div><br class=""><font face="Menlo" size="1" class=""> else if (auto *DT = T->getContainedDeducedType())</font><br class=""><br class="">with<br class=""><br class=""><font face="Menlo" size="1" class="">  else if (auto *DT = T->getAs<DeducedType>())</font></div><div class=""><br class=""></div><div class="">I think that is what you want anyway, since getContainedDeducedType seems to look not only through type sugar but through pointee types, array element types, etc.</div><div class=""><br class=""></div><div class="">To be sure, your example still should have worked using getContainedDeducedType but I think GetContainedDeducedTypeVisitor may have a problem in its implementation: it doesn’t handle all the possible sugar types.   In this case, you probably have a SubstTemplateTypeParmType, and I don’t see a VisitSubstTemplateTypeParmType implementation in there anywhere, so it is probably returning nullptr instead of desugaring and continuing to search.  That’s my best guess anyway from my perusal.</div><div class=""><br class=""></div><div class="">If this change works, it is probably another reason to replace stuff like GetContainedDeducedTypeVisitor with a more advanced getAs<T>(), with an extra template param that would allow you to look through e.g. pointee types, element types, function return types etc. when desired.</div><div class=""><div><br class=""></div><div>If that doesn’t work though, disregard.  Good luck,</div><div><br class=""></div><div>Dave</div><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 21, 2020, at 9:06 AM, Pratyush Das via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi, <div class=""><br class=""></div><div class="">I am a little stuck with <a href="https://reviews.llvm.org/D77598" class="">https://reviews.llvm.org/D77598</a> and would really appreciate any help.</div><div class=""><br class=""></div><div class="">I am trying to get the proper suffixes in the error messages for the following two examples - <br class=""></div><div class=""><br class=""></div><div class=""><font face="monospace" class="">template<auto N> struct S {};</font></div><div class=""><font face="monospace" class="">template<> struct S<1> { using type = int };</font></div><div class=""><font face="monospace" class="">S<1L>::type t;</font></div><div class=""><br class=""></div><div class="">which should give the error message with a suffix - </div><div class=""><font face="monospace" class="">error: no type named 'type' in 'S<1L>'; did you mean 'S<1>::type'?</font></div><div class=""><br class=""></div><div class="">and</div><div class=""><br class=""></div><div class=""><font face="monospace" class="">template <unsigned long long N> struct enable_if_unsigned_long_long {};<br class="">template <> struct enable_if_unsigned_long_long<1> { typedef int type; }; <br class="">void test_unsigned_long_long() { enable_if_unsigned_long_long<2>::type i; } </font><br class=""></div><div class=""><br class=""></div><div class="">which should give no suffix in the error message - </div><div class=""><font face="monospace" class="">error: no type named 'type' in 'enable_if_unsigned_int<2>'; did you mean 'enable_if_unsigned_int<1>::type'?</font><br class=""></div><div class=""><br class=""></div><div class="">I am trying to find the correct combination that would enable suffix in the first case, but not in the second case. I have been tinkering with checks for DeducedType and DependentType, but always either the suffixes are disabled for both the cases, or enabled for both the cases. </div><div class=""><br class=""></div><div class="">Can anyone please provide any insight on how to proceed?</div><div class=""><br clear="all" class=""><div class="">Thanks!</div><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">Pratyush Das(Reik)<br class=""></div></div></div></div></div></div></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></div></body></html>