diff options
author | Michael Matz <matz@suse.de> | 2012-04-20 14:40:09 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2012-04-20 14:40:09 +0000 |
commit | c522573e048c698f1fdcf2442e3a88648e9006bf (patch) | |
tree | 7c431d2e57e35cb25297607739ddc73f0ed0f619 /gcc | |
parent | add6207a867887b9795bb9ad0f445a43b6db38dd (diff) | |
download | gcc-c522573e048c698f1fdcf2442e3a88648e9006bf.zip gcc-c522573e048c698f1fdcf2442e3a88648e9006bf.tar.gz gcc-c522573e048c698f1fdcf2442e3a88648e9006bf.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/error.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0be0be4..1bed03b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 77eb306..858dc5b 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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 |