Commit 81adbcea by Paolo Carlini Committed by Paolo Carlini

re PR c++/64970 (Hard error instead of SFINAE for expression in nested template alias)

/cp
2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/64970
	* decl.c (make_typename_type): Pass tsubst_flags_t argument
	to lookup_template_class.

/testsuite
2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/64970
	* g++.dg/cpp0x/sfinae55.C: New.

From-SVN: r220684
parent 730f474b
2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/64970
* decl.c (make_typename_type): Pass tsubst_flags_t argument
to lookup_template_class.
2015-02-13 Jakub Jelinek <jakub@redhat.com>
PR ipa/65034
......
......@@ -3569,7 +3569,7 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
return lookup_template_class (t, TREE_OPERAND (fullname, 1),
NULL_TREE, context,
/*entering_scope=*/0,
tf_warning_or_error | tf_user);
complain | tf_user);
if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl))
t = TREE_TYPE (t);
......
2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/64970
* g++.dg/cpp0x/sfinae55.C: New.
2015-02-13 Jakub Jelinek <jakub@redhat.com>
PR ipa/65034
......
// PR c++/64970
// { dg-do compile { target c++11 } }
template<typename T>
T && declval();
template<typename T>
struct void_ { using type = void; };
template<typename T>
using void_t = typename void_<T>::type;
template<class A, class B>
struct Outer
{
template<class C, class D>
using Inner = decltype(true ? declval<C>() : declval<D>());
};
template<class A, class B, typename Enable = void>
struct S
{};
template<class A, class B>
struct S<A, B, void_t<typename Outer<A, B>::template Inner<A, B>>>
{};
struct A{};
struct B{};
int main()
{
S<A, B> s;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment