diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2018-02-16 15:34:58 +0000 |
---|---|---|
committer | Paolo Carlini <paolo.carlini@oracle.com> | 2018-02-16 15:34:58 +0000 |
commit | dfb8a9ce63675d88dd412afba479f64b1367fc04 (patch) | |
tree | e8e84e278d7ce7be5673f97431a7ede4a79807db | |
parent | 5dfb7e6b7d1509c845e749a643d34bb77520ca46 (diff) |
/cp
2018-02-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82468
* decl.c (check_special_function_return_type): Reject template
template parameter in deduction guide.
/testsuite
2018-02-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/82468
* g++.dg/cpp1z/class-deduction48.C: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@257740 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1z/class-deduction48.C | 5 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ee3ade9bd05..1da0a4d4a53 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-02-16 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/82468 + * decl.c (check_special_function_return_type): Reject template + template parameter in deduction guide. + 2018-02-16 Nathan Sidwell <nathan@acm.org> PR c++/84375 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 3ccea9e6a45..fbcc778f0cc 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9834,7 +9834,14 @@ check_special_function_return_type (special_function_kind sfk, error_at (smallest_type_quals_location (type_quals, locations), "qualifiers are not allowed on declaration of " "deduction guide"); - type = make_template_placeholder (CLASSTYPE_TI_TEMPLATE (optype)); + if (TREE_CODE (optype) == TEMPLATE_TEMPLATE_PARM) + { + error ("template template parameter %qT in declaration of " + "deduction guide", optype); + type = error_mark_node; + } + else + type = make_template_placeholder (CLASSTYPE_TI_TEMPLATE (optype)); for (int i = 0; i < ds_last; ++i) if (i != ds_explicit && locations[i]) error_at (locations[i], diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 58eb38582d9..068f169ed6d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-02-16 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/82468 + * g++.dg/cpp1z/class-deduction48.C: New. + 2018-02-16 Nathan Sidwell <nathan@acm.org> PR c++/84375 diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction48.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction48.C new file mode 100644 index 00000000000..1cfdc44a993 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction48.C @@ -0,0 +1,5 @@ +// PR c++/82468 +// { dg-options -std=c++17 } + +template <template <class> class TT> +TT(double) -> TT<int>; // { dg-error "template template" } |