Skip to content

Commit

Permalink
fix: call destructor correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ToruNiina committed Jun 16, 2024
1 parent 835d38a commit fbfdb6a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/toml11/result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,12 @@ struct result
#if defined(__GNUC__) && ! defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wduplicated-branches"
#endif

if(this->is_ok_) {this->succ.~success_type();}
else {this->fail.~failure_type();}

#if defined(__GNUC__) && ! defined(__clang__)
#pragma GCC diagnostic pop
#endif
return;
Expand Down

0 comments on commit fbfdb6a

Please sign in to comment.