<div dir="ltr">That change does not work :( <div><br></div><div>Thanks though! </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 21 Jul 2020 at 23:30, David Rector <<a href="mailto:davrecthreads@gmail.com">davrecthreads@gmail.com</a>> 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"><div style="overflow-wrap: break-word;"><div><font face="Menlo, Consolas, Monaco, monospace"><span style="background-color:rgba(151,234,151,0.6)"><br></span></font><div>I would try replacing</div><br><font face="Menlo" size="1"> else if (auto *DT = T->getContainedDeducedType())</font><br><br>with<br><br><font face="Menlo" size="1">  else if (auto *DT = T->getAs<DeducedType>())</font></div><div><br></div><div>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><br></div><div>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><br></div><div>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><div><br></div><div>If that doesn’t work though, disregard.  Good luck,</div><div><br></div><div>Dave</div><div><br><blockquote type="cite"><div>On Jul 21, 2020, at 9:06 AM, Pratyush Das via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr">Hi, <div><br></div><div>I am a little stuck with <a href="https://reviews.llvm.org/D77598" target="_blank">https://reviews.llvm.org/D77598</a> and would really appreciate any help.</div><div><br></div><div>I am trying to get the proper suffixes in the error messages for the following two examples - <br></div><div><br></div><div><font face="monospace">template<auto N> struct S {};</font></div><div><font face="monospace">template<> struct S<1> { using type = int };</font></div><div><font face="monospace">S<1L>::type t;</font></div><div><br></div><div>which should give the error message with a suffix - </div><div><font face="monospace">error: no type named 'type' in 'S<1L>'; did you mean 'S<1>::type'?</font></div><div><br></div><div>and</div><div><br></div><div><font face="monospace">template <unsigned long long N> struct enable_if_unsigned_long_long {};<br>template <> struct enable_if_unsigned_long_long<1> { typedef int type; }; <br>void test_unsigned_long_long() { enable_if_unsigned_long_long<2>::type i; } </font><br></div><div><br></div><div>which should give no suffix in the error message - </div><div><font face="monospace">error: no type named 'type' in 'enable_if_unsigned_int<2>'; did you mean 'enable_if_unsigned_int<1>::type'?</font><br></div><div><br></div><div>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><br></div><div>Can anyone please provide any insight on how to proceed?</div><div><br clear="all"><div>Thanks!</div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>Pratyush Das(Reik)<br></div></div></div></div></div></div></div>
_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br></div></blockquote></div><br></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Pratyush Das(Reik)<br></div></div></div></div></div>