Thanks, I merged it in r258549. -Dimitry
> On 22 Jan 2016, at 21:43, Hans Wennborg <h...@chromium.org> wrote: > > It seems Richard is out of office, but perhaps he can verify this later. > > Dimitry: go ahead and merge it (or let me know if you'd like me to). > > On Fri, Jan 22, 2016 at 12:38 PM, Dimitry Andric <dimi...@andric.com> wrote: >> Hans, >> >> This change looks pretty trivial, and is required to not crash for the test >> cases in PR26134. Can we merge it to release_38, please? >> >> -Dimitry >> >>> On 19 Jan 2016, at 19:28, Dimitry Andric via cfe-commits >>> <cfe-commits@lists.llvm.org> wrote: >>> >>> Hi Richard, >>> >>> I am unsure if you are specifically the code owner of Sema, but can you >>> please approve this change for the 3.8 branch? >>> >>> -Dimitry >>> >>>> On 19 Jan 2016, at 04:58, Faisal Vali via cfe-commits >>>> <cfe-commits@lists.llvm.org> wrote: >>>> >>>> Author: faisalv >>>> Date: Mon Jan 18 21:58:55 2016 >>>> New Revision: 258110 >>>> >>>> URL: http://llvm.org/viewvc/llvm-project?rev=258110&view=rev >>>> Log: >>>> Fix PR26134: When substituting into default template arguments, keep >>>> CurContext unchanged. >>>> >>>> Or, do not set Sema's CurContext to the template declaration's when >>>> substituting into default template arguments of said template declaration. >>>> If we do push the template declaration context on to Sema, and the >>>> template declaration is at namespace scope, Sema can get confused and try >>>> and do odr analysis when substituting into default template arguments, >>>> even though the substitution could be occurring within a dependent context. >>>> I'm not sure why this was being done, perhaps there was concern that if a >>>> default template argument referred to a previous template parameter, it >>>> might not be found during substitution - but all regression tests pass, >>>> and I can't craft a test that would cause it to fails (if some one does, >>>> please inform me, and i'll craft a different fix for the PR). >>>> >>>> >>>> This patch removes a single line of code, but unfortunately adds more than >>>> it removes, because of the tests. Some day I still hope to commit a patch >>>> that removes far more lines than it adds, while leaving clang better for >>>> it ;) >>>> >>>> Sorry that r253590 ("Change the expression evaluation context from >>>> Unevaluated to ConstantEvaluated while substituting into non-type template >>>> argument defaults") caused the PR! >>>> >>>> >>>> >>>> >>>> >>>> Modified: >>>> cfe/trunk/lib/Sema/SemaTemplate.cpp >>>> cfe/trunk/test/SemaTemplate/default-arguments.cpp >>>> >>>> Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp >>>> URL: >>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=258110&r1=258109&r2=258110&view=diff >>>> ============================================================================== >>>> --- cfe/trunk/lib/Sema/SemaTemplate.cpp (original) >>>> +++ cfe/trunk/lib/Sema/SemaTemplate.cpp Mon Jan 18 21:58:55 2016 >>>> @@ -3281,7 +3281,6 @@ SubstDefaultTemplateArgument(Sema &SemaR >>>> for (unsigned i = 0, e = Param->getDepth(); i != e; ++i) >>>> TemplateArgLists.addOuterTemplateArguments(None); >>>> >>>> - Sema::ContextRAII SavedContext(SemaRef, Template->getDeclContext()); >>>> EnterExpressionEvaluationContext ConstantEvaluated(SemaRef, >>>> >>>> Sema::ConstantEvaluated); >>>> return SemaRef.SubstExpr(Param->getDefaultArgument(), TemplateArgLists); >>>> >>>> Modified: cfe/trunk/test/SemaTemplate/default-arguments.cpp >>>> URL: >>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/default-arguments.cpp?rev=258110&r1=258109&r2=258110&view=diff >>>> ============================================================================== >>>> --- cfe/trunk/test/SemaTemplate/default-arguments.cpp (original) >>>> +++ cfe/trunk/test/SemaTemplate/default-arguments.cpp Mon Jan 18 21:58:55 >>>> 2016 >>>> @@ -179,3 +179,31 @@ struct C { >>>> C(T t = ); // expected-error {{expected expression}} >>>> }; >>>> C<int> obj; >>>> + >>>> +namespace PR26134 { >>>> +// Make sure when substituting default template arguments we do it in the >>>> current context. >>>> +template<class T, bool Val = T::value> >>>> +struct X {}; >>>> + >>>> +template<bool B> struct Y { >>>> + void f() { X<Y> xy; } >>>> + static const bool value = B; >>>> +}; >>>> + >>>> +namespace ns1 { >>>> +template<class T0> >>>> +struct X { >>>> + template<bool B = T0::value> struct XInner { static const bool value = >>>> B; }; >>>> +}; >>>> +template<bool B> struct S { static const bool value = B; }; >>>> +#if __cplusplus > 199711L >>>> +template<bool B> struct Y { >>>> + static constexpr bool f() { return typename X<S<B>>::template >>>> XInner<>{}.value; } >>>> + static_assert(f() == B, ""); >>>> +}; >>>> +Y<true> y; >>>> +Y<false> y2; >>>> +#endif >>>> + >>>> +} // end ns1 >>>> +} // end ns PR26134 >>>> >>>> >>>> _______________________________________________ >>>> cfe-commits mailing list >>>> cfe-commits@lists.llvm.org >>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >>> >>> _______________________________________________ >>> cfe-commits mailing list >>> cfe-commits@lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >>
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits