Commit 2482a4ec by Paolo Carlini Committed by Paolo Carlini

re PR c++/84350 (ICE with new and auto)

/cp
2018-02-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84350
	* pt.c (do_auto_deduction): Don't check the TREE_TYPE of a null
	init, early return.

/testsuite
2018-02-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/84350
	* g++.dg/cpp0x/auto49.C: New.

From-SVN: r257666
parent 486c5299
2018-02-14 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84350
* pt.c (do_auto_deduction): Don't check the TREE_TYPE of a null
init, early return.
2018-02-14 Nathan Sidwell <nathan@acm.org>
* decl2.c (mark_vtable_entries): Set input_location to decl's.
......
......@@ -25975,7 +25975,7 @@ do_auto_deduction (tree type, tree init, tree auto_node,
/* C++17 class template argument deduction. */
return do_class_deduction (type, tmpl, init, flags, complain);
if (TREE_TYPE (init) == NULL_TREE)
if (init == NULL_TREE || TREE_TYPE (init) == NULL_TREE)
/* Nothing we can do with this, even in deduction context. */
return type;
......
2018-02-14 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84350
* g++.dg/cpp0x/auto49.C: New.
2018-02-14 Nathan Sidwell <nathan@acm.org>
* g++.dg/template/instantiate5.C: Adjust required-from loc.
......
// PR c++/84350
// { dg-do compile { target c++11 } }
template<typename... T> void foo(T... t)
{
new auto(t...); // { dg-error "invalid use" }
}
void bar()
{
foo();
}
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