mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-17 03:02:24 +01:00
Fix compilation error with old GCC versions.
Compilation failed with GCC 4.3.3 under QNX 6.4.1. This use of auto_ptr's operator= is not supported. Change to reset() which has the same functionality with new pointers, applying to both auto_ptr and unique_ptr.
This commit is contained in:
parent
44aa45cc4f
commit
4abb5a2af7
4
include/external/clara.h
vendored
4
include/external/clara.h
vendored
@ -620,7 +620,7 @@ namespace Clara {
|
|||||||
m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
|
m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
|
||||||
{
|
{
|
||||||
if( other.m_floatingArg.get() )
|
if( other.m_floatingArg.get() )
|
||||||
m_floatingArg = ArgAutoPtr( new Arg( *other.m_floatingArg ) );
|
m_floatingArg .reset( new Arg( *other.m_floatingArg ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
|
CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
|
||||||
@ -649,7 +649,7 @@ namespace Clara {
|
|||||||
ArgBuilder operator[]( UnpositionalTag ) {
|
ArgBuilder operator[]( UnpositionalTag ) {
|
||||||
if( m_floatingArg.get() )
|
if( m_floatingArg.get() )
|
||||||
throw std::logic_error( "Only one unpositional argument can be added" );
|
throw std::logic_error( "Only one unpositional argument can be added" );
|
||||||
m_floatingArg = ArgAutoPtr( new Arg() );
|
m_floatingArg.reset( new Arg() );
|
||||||
ArgBuilder builder( m_floatingArg.get() );
|
ArgBuilder builder( m_floatingArg.get() );
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
@ -3630,7 +3630,7 @@ namespace Clara {
|
|||||||
m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
|
m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
|
||||||
{
|
{
|
||||||
if( other.m_floatingArg.get() )
|
if( other.m_floatingArg.get() )
|
||||||
m_floatingArg = ArgAutoPtr( new Arg( *other.m_floatingArg ) );
|
m_floatingArg.reset( new Arg( *other.m_floatingArg ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
|
CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
|
||||||
@ -3658,7 +3658,7 @@ namespace Clara {
|
|||||||
ArgBuilder operator[]( UnpositionalTag ) {
|
ArgBuilder operator[]( UnpositionalTag ) {
|
||||||
if( m_floatingArg.get() )
|
if( m_floatingArg.get() )
|
||||||
throw std::logic_error( "Only one unpositional argument can be added" );
|
throw std::logic_error( "Only one unpositional argument can be added" );
|
||||||
m_floatingArg = ArgAutoPtr( new Arg() );
|
m_floatingArg.reset( new Arg() );
|
||||||
ArgBuilder builder( m_floatingArg.get() );
|
ArgBuilder builder( m_floatingArg.get() );
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user