diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1z/nontype-auto15.C | 6 |
3 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 55a083f..ad4dba4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2019-04-04 Jason Merrill <jason@redhat.com> + PR c++/89966 - error with non-type auto tparm. + * pt.c (do_auto_deduction): Clear tf_partial. + +2019-04-04 Jason Merrill <jason@redhat.com> + PR c++/86986 - ICE with TTP with parameter pack. * pt.c (coerce_template_parameter_pack): Only look at the type of a non-type parameter pack. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 20647be..40d954d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -27504,6 +27504,10 @@ do_auto_deduction (tree type, tree init, tree auto_node, if (init && undeduced_auto_decl (init)) return type; + /* We may be doing a partial substitution, but we still want to replace + auto_node. */ + complain &= ~tf_partial; + if (tree tmpl = CLASS_PLACEHOLDER_TEMPLATE (auto_node)) /* C++17 class template argument deduction. */ return do_class_deduction (type, tmpl, init, flags, complain); diff --git a/gcc/testsuite/g++.dg/cpp1z/nontype-auto15.C b/gcc/testsuite/g++.dg/cpp1z/nontype-auto15.C new file mode 100644 index 0000000..d94885d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/nontype-auto15.C @@ -0,0 +1,6 @@ +// PR c++/89966 +// { dg-do compile { target c++17 } } + +template < auto a0 > +void f0() { } +void f0_call() { f0< sizeof(int) >(); } |