diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-02-13 14:54:48 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-02-13 14:54:48 +0000 |
commit | 81adbcea49c3dbc5bb1fe4211e113a9141d13263 (patch) | |
tree | 4c1ad077c7b21025e1bc44dee91749b2d1617b6d /gcc | |
parent | 730f474bf90d59582144b23c9176276ab680ef56 (diff) | |
download | gcc-81adbcea49c3dbc5bb1fe4211e113a9141d13263.zip gcc-81adbcea49c3dbc5bb1fe4211e113a9141d13263.tar.gz gcc-81adbcea49c3dbc5bb1fe4211e113a9141d13263.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/sfinae55.C | 33 |
4 files changed, 45 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8132e2f..a39acaa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f95a61a..bc481bf 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 5c9ff2e..efdc9dc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae55.C b/gcc/testsuite/g++.dg/cpp0x/sfinae55.C new file mode 100644 index 0000000..7b6557e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae55.C @@ -0,0 +1,33 @@ +// 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; +} |