Skip to content

Commit 491cb17

Browse files
committed
Fix uninitialized validation_error::m_kind.
1 parent d295fcc commit 491cb17

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/boost/program_options/errors.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,15 @@ namespace boost { namespace program_options {
375375
const std::string& option_name = "",
376376
const std::string& original_token = "",
377377
int option_style = 0):
378-
error_with_option_name(get_template(kind), option_name, original_token, option_style)
378+
error_with_option_name(get_template(kind), option_name, original_token, option_style),
379+
m_kind(kind)
379380
{
380381
}
381382

382383
~validation_error() throw() {}
383384

385+
kind_t kind() const { return m_kind; }
386+
384387
protected:
385388
/** Used to convert kind_t to a related error text */
386389
std::string get_template(kind_t kind);

0 commit comments

Comments
 (0)