Commit b10c7cd7 by Jason Merrill Committed by Jason Merrill

PR c++/79556 - C++17 ICE with non-type auto

	* pt.c (do_auto_deduction): Don't try to deduce from null type.

From-SVN: r245543
parent 34a64e47
2017-02-17 Jason Merrill <jason@redhat.com> 2017-02-17 Jason Merrill <jason@redhat.com>
PR c++/79556 - C++17 ICE with non-type auto
* pt.c (do_auto_deduction): Don't try to deduce from null type.
PR c++/79533 - C++17 ICE with temporary cast to reference PR c++/79533 - C++17 ICE with temporary cast to reference
* call.c (build_over_call): Conversion to a reference prevents copy * call.c (build_over_call): Conversion to a reference prevents copy
elision. elision.
......
...@@ -25191,6 +25191,10 @@ do_auto_deduction (tree type, tree init, tree auto_node, ...@@ -25191,6 +25191,10 @@ do_auto_deduction (tree type, tree init, tree auto_node,
/* C++17 class template argument deduction. */ /* C++17 class template argument deduction. */
return do_class_deduction (type, tmpl, init, flags, complain); return do_class_deduction (type, tmpl, init, flags, complain);
if (TREE_TYPE (init) == NULL_TREE)
/* Nothing we can do with this, even in deduction context. */
return type;
/* [dcl.spec.auto]: Obtain P from T by replacing the occurrences of auto /* [dcl.spec.auto]: Obtain P from T by replacing the occurrences of auto
with either a new invented type template parameter U or, if the with either a new invented type template parameter U or, if the
initializer is a braced-init-list (8.5.4), with initializer is a braced-init-list (8.5.4), with
......
// PR c++/79556
// { dg-options -std=c++1z }
template <auto> struct A;
template <auto...> struct B;
template <int N, auto Dim, auto... Dims> struct B<N, Dim, Dims...> {
static auto a = A<B<Dims...>::value>::value;
};
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