Skip to content

Commit

Permalink
Remove noexcepts from Config (#1523)
Browse files Browse the repository at this point in the history
Fixes #1515.

By removing these `noexcept`s, we guarantee that the internal call to
`std::swap` uses move semantics when a `Config` is copy-assigned.
  • Loading branch information
vrn-sn authored Nov 12, 2024
1 parent 53e6e4b commit d1025d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Config/include/Luau/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ constexpr const char* kConfigName = ".luaurc";
struct Config
{
Config();
Config(const Config& other) noexcept;
Config& operator=(const Config& other) noexcept;
Config(Config&& other) noexcept = default;
Config& operator=(Config&& other) noexcept = default;
Config(const Config& other);
Config& operator=(const Config& other);
Config(Config&& other) = default;
Config& operator=(Config&& other) = default;

Mode mode = Mode::Nonstrict;

Expand Down
4 changes: 2 additions & 2 deletions Config/src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Config::Config()
enabledLint.setDefaults();
}

Config::Config(const Config& other) noexcept
Config::Config(const Config& other)
: mode(other.mode)
, parseOptions(other.parseOptions)
, enabledLint(other.enabledLint)
Expand All @@ -40,7 +40,7 @@ Config::Config(const Config& other) noexcept
}
}

Config& Config::operator=(const Config& other) noexcept
Config& Config::operator=(const Config& other)
{
if (this != &other)
{
Expand Down

0 comments on commit d1025d0

Please sign in to comment.