Commit f80aa399 by Marek Polacek Committed by Marek Polacek

PR c++/88825 - ICE with bogus function return type deduction.

	* typeck.c (can_do_nrvo_p): Check error_mark_node.

	* g++.dg/cpp1y/auto-fn55.C: New test.

From-SVN: r267926
parent a30d0196
......@@ -4,6 +4,9 @@
* decl2.c (maybe_emit_vtables): Check CLASSTYPE_LAZY_DESTRUCTOR.
Fix formatting.
PR c++/88825 - ICE with bogus function return type deduction.
* typeck.c (can_do_nrvo_p): Check error_mark_node.
2019-01-14 Tom Honermann <tom@honermann.net>
Implement P0482R5, char8_t: A type for UTF-8 characters and strings
......
......@@ -9343,6 +9343,8 @@ is_std_move_p (tree fn)
static bool
can_do_nrvo_p (tree retval, tree functype)
{
if (functype == error_mark_node)
return false;
if (retval)
STRIP_ANY_LOCATION_WRAPPER (retval);
tree result = DECL_RESULT (current_function_decl);
......
2019-01-14 Marek Polacek <polacek@redhat.com>
PR c++/88825 - ICE with bogus function return type deduction.
* g++.dg/cpp1y/auto-fn55.C: New test.
2019-01-14 Jakub Jelinek <jakub@redhat.com>
* g++.dg/cpp1z/feat-cxx1z.C: Add tests for
......
// PR c++/88825
// { dg-do compile { target c++14 } }
auto f () -> auto *
{
int t = 0;
return t; // { dg-error "unable to deduce" }
}
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