Skip to content

Commit 88719cf

Browse files
committed
Tweak validator to workaround prob in older GCCs
1 parent 688730b commit 88719cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/src_common/common/program_options/validator.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ namespace cath {
6262

6363
// Attempt to lexical_cast value_string and if it fails, throw an invalid_option_value exception
6464
try {
65-
return U{ boost::lexical_cast<T>( value_string ) };
65+
// Come all GCC versions > 4.9, just use `U{ }` rather than the `static_cast`
66+
// which appears to confuse older GCCs to try aggregate initialization over copy
67+
// construction in some cases
68+
return static_cast<U>( boost::lexical_cast<T>( value_string ) );
6669
}
6770
catch (...) {
6871
BOOST_THROW_EXCEPTION( boost::program_options::invalid_option_value( value_string ) );

0 commit comments

Comments
 (0)