]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
error.c (pedwarn_cxx98): Move va_end call after user of the va_list.
authorMichael Matz <matz@suse.de>
Fri, 20 Apr 2012 14:40:09 +0000 (14:40 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Fri, 20 Apr 2012 14:40:09 +0000 (14:40 +0000)
* error.c (pedwarn_cxx98): Move va_end call after user
of the va_list.

From-SVN: r186626

gcc/cp/ChangeLog
gcc/cp/error.c

index 0be0be4b6a1021162dcd53a682057848bcb715c4..1bed03b73942446e22b6b9ef627e2000c74fbf2d 100644 (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
index 77eb306823c57831948ffd52ede59bb6a9d20103..858dc5bb4e894967432edd1ce1b13ac0a53f4f1b 100644 (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