From: Paolo Carlini Date: Fri, 13 Feb 2015 14:54:48 +0000 (+0000) Subject: re PR c++/64970 (Hard error instead of SFINAE for expression in nested template alias) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81adbcea49c3dbc5bb1fe4211e113a9141d13263;p=gcc.git re PR c++/64970 (Hard error instead of SFINAE for expression in nested template alias) /cp 2015-02-13 Paolo Carlini PR c++/64970 * decl.c (make_typename_type): Pass tsubst_flags_t argument to lookup_template_class. /testsuite 2015-02-13 Paolo Carlini PR c++/64970 * g++.dg/cpp0x/sfinae55.C: New. From-SVN: r220684 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8132e2feee6..a39acaab759 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-13 Paolo Carlini + + PR c++/64970 + * decl.c (make_typename_type): Pass tsubst_flags_t argument + to lookup_template_class. + 2015-02-13 Jakub Jelinek PR ipa/65034 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f95a61a4487..bc481bfe2f5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5c9ff2e2f94..efdc9dce317 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-13 Paolo Carlini + + PR c++/64970 + * g++.dg/cpp0x/sfinae55.C: New. + 2015-02-13 Jakub Jelinek PR ipa/65034 diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae55.C b/gcc/testsuite/g++.dg/cpp0x/sfinae55.C new file mode 100644 index 00000000000..7b6557ee7d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae55.C @@ -0,0 +1,33 @@ +// PR c++/64970 +// { dg-do compile { target c++11 } } + +template +T && declval(); + +template +struct void_ { using type = void; }; + +template +using void_t = typename void_::type; + +template +struct Outer +{ + template + using Inner = decltype(true ? declval() : declval()); +}; + +template +struct S +{}; + +template +struct S::template Inner>> +{}; + +struct A{}; +struct B{}; +int main() +{ + S s; +}