diff options
author | James Zern <jzern@google.com> | 2023-03-10 16:19:50 -0800 |
---|---|---|
committer | James Zern <jzern@google.com> | 2023-03-10 18:37:55 -0800 |
commit | 7575ef412c3dadece731201e5fb3ffacde6d304c (patch) | |
tree | 8c3e3047084e809ab4be7d9a742beb9194ab1c57 | |
parent | c68f89fd9adca0d253e1cc39062cf5ae8012e1b9 (diff) | |
download | libwebm-7575ef412c3dadece731201e5fb3ffacde6d304c.tar.gz |
vp9_level_stats,Vp9LevelRow: fix -Wc++20-compat warnings
This makes the struct an aggregate in C++20 terms [1], by removing the
default constructor. Another option would be to provide an explicit
constructor taking all of the members as arguments.
fixes:
common/vp9_level_stats.cc:20:5: warning: aggregate initialization of
type 'const vp9_parser::Vp9LevelRow' with user-declared constructors is
incompatible with C++20 [-Wc++20-compat]
[1] https://en.cppreference.com/w/cpp/language/aggregate_initialization
C++11: no user-provided, inherited, or explicit constructors
C++20: no user-declared or inherited constructors
Change-Id: I32fbee85016ea711a7425317493d5cf3c0a3b93d
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | common/vp9_level_stats.h | 7 |
2 files changed, 3 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a83d23b..99e904f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,9 @@ if (MSVC) endif () else () add_cxx_flag_if_supported("-Wall") + add_cxx_flag_if_supported("-Wc++14-compat") + add_cxx_flag_if_supported("-Wc++17-compat") + add_cxx_flag_if_supported("-Wc++20-compat") add_cxx_flag_if_supported("-Wextra") add_cxx_flag_if_supported("-Wnarrowing") add_cxx_flag_if_supported("-Wno-deprecated") diff --git a/common/vp9_level_stats.h b/common/vp9_level_stats.h index 45d6f5c..9e728d2 100644 --- a/common/vp9_level_stats.h +++ b/common/vp9_level_stats.h @@ -40,13 +40,6 @@ enum Vp9Level { }; struct Vp9LevelRow { - Vp9LevelRow() = default; - ~Vp9LevelRow() = default; - Vp9LevelRow(Vp9LevelRow&& other) = default; - Vp9LevelRow(const Vp9LevelRow& other) = default; - Vp9LevelRow& operator=(Vp9LevelRow&& other) = delete; - Vp9LevelRow& operator=(const Vp9LevelRow& other) = delete; - Vp9Level level; int64_t max_luma_sample_rate; int64_t max_luma_picture_size; |