Commit 61856507 by Marek Polacek Committed by Marek Polacek

cxx-pretty-print.c (cxx_pretty_printer::statement): Handle RANGE_FOR_INIT_STMT.

	* cxx-pretty-print.c (cxx_pretty_printer::statement) <case
	RANGE_FOR_SMT>: Handle RANGE_FOR_INIT_STMT.

From-SVN: r264170
parent e00dfa84
2018-09-08 Marek Polacek <polacek@redhat.com>
* cxx-pretty-print.c (cxx_pretty_printer::statement) <case
RANGE_FOR_SMT>: Handle RANGE_FOR_INIT_STMT.
2018-09-07 Marek Polacek <polacek@redhat.com> 2018-09-07 Marek Polacek <polacek@redhat.com>
PR c++/87152 - range-based for loops with initializer broken in templates. PR c++/87152 - range-based for loops with initializer broken in templates.
......
...@@ -2021,6 +2021,12 @@ cxx_pretty_printer::statement (tree t) ...@@ -2021,6 +2021,12 @@ cxx_pretty_printer::statement (tree t)
pp_cxx_ws_string (this, "for"); pp_cxx_ws_string (this, "for");
pp_space (this); pp_space (this);
pp_cxx_left_paren (this); pp_cxx_left_paren (this);
if (RANGE_FOR_INIT_STMT (t))
{
statement (RANGE_FOR_INIT_STMT (t));
pp_needs_newline (this) = false;
pp_cxx_whitespace (this);
}
statement (RANGE_FOR_DECL (t)); statement (RANGE_FOR_DECL (t));
pp_space (this); pp_space (this);
pp_needs_newline (this) = false; pp_needs_newline (this) = false;
......
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