<div dir="ltr">I understand your rationale but isn't this what you'd call a regression test?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 21, 2014 at 12:38 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Wed, Aug 20, 2014 at 6:33 PM, Nikola Smiljanic <<a href="mailto:popizdeh@gmail.com">popizdeh@gmail.com</a>> wrote:<br>


> Are you saying you ran the test case without my change and it didn't crash?<br>
<br>
</div>No, I'm saying a test that only ensures the compiler doesn't crash is<br>
usually not a very good test. We usually want a program to do<br>
something more specific than "does not crash" - and the test should<br>
test for that specific behavior, not merely the absence of a crash.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Just -cc1 -fms-compatibility -fsyntax-only and you should see it.<br>
><br>
><br>
> On Thu, Aug 21, 2014 at 11:31 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> On Wed, Aug 20, 2014 at 5:19 PM, Nikola Smiljanić <<a href="mailto:popizdeh@gmail.com">popizdeh@gmail.com</a>><br>
>> wrote:<br>
>> > Hi rnk,<br>
>> ><br>
>> > The call to cast crashes because getTemplateDecl returns null for<br>
>> > TemplateTemplateParmDecls.<br>
>> ><br>
>> > <a href="http://reviews.llvm.org/D4992" target="_blank">http://reviews.llvm.org/D4992</a><br>
>> ><br>
>> > Files:<br>
>> >   lib/Sema/SemaDecl.cpp<br>
>> >   test/SemaTemplate/ms-lookup-template-base-classes.cpp<br>
>> ><br>
>> > Index: lib/Sema/SemaDecl.cpp<br>
>> > ===================================================================<br>
>> > --- lib/Sema/SemaDecl.cpp<br>
>> > +++ lib/Sema/SemaDecl.cpp<br>
>> > @@ -150,7 +150,7 @@<br>
>> >      if (!TST || !TST->isDependentType())<br>
>> >        continue;<br>
>> >      auto *TD = TST->getTemplateName().getAsTemplateDecl();<br>
>> > -    if (!TD)<br>
>> > +       if (!TD || !TD->getTemplatedDecl())<br>
>><br>
>> Looks like the indentation might've broken here? (or maybe it's just<br>
>> misrendering in the email)<br>
>><br>
>> >        continue;<br>
>> >      auto *BasePrimaryTemplate =<br>
>> > cast<CXXRecordDecl>(TD->getTemplatedDecl());<br>
>> >      // FIXME: Allow lookup into non-dependent bases of dependent bases,<br>
>> > possibly<br>
>> > Index: test/SemaTemplate/ms-lookup-template-base-classes.cpp<br>
>> > ===================================================================<br>
>> > --- test/SemaTemplate/ms-lookup-template-base-classes.cpp<br>
>> > +++ test/SemaTemplate/ms-lookup-template-base-classes.cpp<br>
>> > @@ -460,3 +460,19 @@<br>
>> >    int x = f<NameFromBase>();<br>
>> >  };<br>
>> >  }<br>
>> > +<br>
>> > +namespace PR20716 {<br>
>><br>
>> Test cases that just "don't crash" always seem a bit questionable to<br>
>> me - is there some behavior this should be testing for?<br>
>><br>
>> > +template <class T><br>
>> > +struct A<br>
>> > +{<br>
>> > +  void foo() {}<br>
>> > +};<br>
>> > +<br>
>> > +template <template <typename T> class C><br>
>> > +struct B : public C<int><br>
>> > +{<br>
>> > +  void bar() {<br>
>> > +    foo();<br>
>> > +  }<br>
>> > +};<br>
>> > +}<br>
>> ><br>
>> > _______________________________________________<br>
>> > cfe-commits mailing list<br>
>> > <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
>> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>