error.c (pedwarn_cxx98): Move va_end call after user of the va_list.

* error.c (pedwarn_cxx98): Move va_end call after user
	of the va_list.

From-SVN: r186626
This commit is contained in:
Michael Matz 2012-04-20 14:40:09 +00:00 committed by Michael Matz
parent add6207a86
commit c522573e04
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-04-20 Michael Matz <matz@suse.de>
* error.c (pedwarn_cxx98): Move va_end call after user
of the va_list.
2012-04-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52422

View File

@ -3352,13 +3352,15 @@ pedwarn_cxx98 (location_t location, int opt, const char *gmsgid, ...)
{
diagnostic_info diagnostic;
va_list ap;
bool ret;
va_start (ap, gmsgid);
diagnostic_set_info (&diagnostic, gmsgid, &ap, location,
(cxx_dialect == cxx98) ? DK_PEDWARN : DK_WARNING);
diagnostic.option_index = opt;
ret = report_diagnostic (&diagnostic);
va_end (ap);
return report_diagnostic (&diagnostic);
return ret;
}
/* Issue a diagnostic that NAME cannot be found in SCOPE. DECL is what