Fix clang style errors in rtp_rtcp and dependant targets

Mark functions with override instead of virtual.
Add explicit non-trivial constructors/assign operators/destructors.
Define them in .cc files instead of inlining
use auto* instead of auto when deduced type is raw pointer

Bug: webrtc:163
Change-Id: I4d8a05d6a64fcc2ca16d02c5fcf9488fda832a6d
Reviewed-on: https://webrtc-review.googlesource.com/48781
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21927}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index 41130f5..63bc99c 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -69,6 +69,7 @@
     "rtp_headers.h",
     "rtpparameters.cc",
     "rtpparameters.h",
+    "rtpreceiverinterface.cc",
     "rtpreceiverinterface.h",
     "rtpsenderinterface.h",
     "rtptransceiverinterface.h",
diff --git a/api/mediastreaminterface.cc b/api/mediastreaminterface.cc
index 0bc5d61..6f08a0c 100644
--- a/api/mediastreaminterface.cc
+++ b/api/mediastreaminterface.cc
@@ -45,4 +45,17 @@
   return new_stats;
 }
 
+VideoTrackInterface::ContentHint VideoTrackInterface::content_hint() const {
+  return ContentHint::kNone;
+}
+
+bool AudioTrackInterface::GetSignalLevel(int* level) {
+  return false;
+}
+
+rtc::scoped_refptr<AudioProcessorInterface>
+AudioTrackInterface::GetAudioProcessor() {
+  return nullptr;
+}
+
 }  // namespace webrtc
diff --git a/api/mediastreaminterface.h b/api/mediastreaminterface.h
index 3273c6d..b7ba332 100644
--- a/api/mediastreaminterface.h
+++ b/api/mediastreaminterface.h
@@ -72,7 +72,7 @@
   virtual bool remote() const = 0;
 
  protected:
-  virtual ~MediaSourceInterface() {}
+  ~MediaSourceInterface() override = default;
 };
 
 // C++ version of MediaStreamTrack.
@@ -106,7 +106,7 @@
   virtual TrackState state() const = 0;
 
  protected:
-  virtual ~MediaStreamTrackInterface() {}
+  ~MediaStreamTrackInterface() override = default;
 };
 
 // VideoTrackSourceInterface is a reference counted source used for
@@ -147,7 +147,7 @@
   virtual bool GetStats(Stats* stats) = 0;
 
  protected:
-  virtual ~VideoTrackSourceInterface() {}
+  ~VideoTrackSourceInterface() override = default;
 };
 
 // VideoTrackInterface is designed to be invoked on the signaling thread except
@@ -173,11 +173,11 @@
 
   virtual VideoTrackSourceInterface* GetSource() const = 0;
 
-  virtual ContentHint content_hint() const { return ContentHint::kNone; }
+  virtual ContentHint content_hint() const;
   virtual void set_content_hint(ContentHint hint) {}
 
  protected:
-  virtual ~VideoTrackInterface() {}
+  ~VideoTrackInterface() override = default;
 };
 
 // Interface for receiving audio data from a AudioTrack.
@@ -269,7 +269,7 @@
   virtual AudioProcessorStatistics GetStats(bool has_remote_tracks);
 
  protected:
-  virtual ~AudioProcessorInterface() {}
+  ~AudioProcessorInterface() override = default;
 };
 
 class AudioTrackInterface : public MediaStreamTrackInterface {
@@ -286,17 +286,15 @@
   // Return true on success, otherwise false.
   // TODO(deadbeef): Change the interface to int GetSignalLevel() and pure
   // virtual after it's implemented in chromium.
-  virtual bool GetSignalLevel(int* level) { return false; }
+  virtual bool GetSignalLevel(int* level);
 
   // Get the audio processor used by the audio track. Return null if the track
   // does not have any processor.
   // TODO(deadbeef): Make the interface pure virtual.
-  virtual rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor() {
-    return nullptr;
-  }
+  virtual rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor();
 
  protected:
-  virtual ~AudioTrackInterface() {}
+  ~AudioTrackInterface() override = default;
 };
 
 typedef std::vector<rtc::scoped_refptr<AudioTrackInterface> >
@@ -331,7 +329,7 @@
   virtual bool RemoveTrack(VideoTrackInterface* track) = 0;
 
  protected:
-  virtual ~MediaStreamInterface() {}
+  ~MediaStreamInterface() override = default;
 };
 
 }  // namespace webrtc
diff --git a/api/rtpreceiverinterface.cc b/api/rtpreceiverinterface.cc
new file mode 100644
index 0000000..b62f744
--- /dev/null
+++ b/api/rtpreceiverinterface.cc
@@ -0,0 +1,48 @@
+/*
+ *  Copyright 2018 The WebRTC Project Authors. All rights reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "api/rtpreceiverinterface.h"
+
+namespace webrtc {
+
+RtpSource::RtpSource(int64_t timestamp_ms,
+                     uint32_t source_id,
+                     RtpSourceType source_type)
+    : timestamp_ms_(timestamp_ms),
+      source_id_(source_id),
+      source_type_(source_type) {}
+
+RtpSource::RtpSource(int64_t timestamp_ms,
+                     uint32_t source_id,
+                     RtpSourceType source_type,
+                     uint8_t audio_level)
+    : timestamp_ms_(timestamp_ms),
+      source_id_(source_id),
+      source_type_(source_type),
+      audio_level_(audio_level) {}
+
+RtpSource::RtpSource(const RtpSource&) = default;
+RtpSource& RtpSource::operator=(const RtpSource&) = default;
+RtpSource::~RtpSource() = default;
+
+std::vector<rtc::scoped_refptr<MediaStreamInterface>>
+RtpReceiverInterface::streams() const {
+  return {};
+}
+
+std::vector<RtpSource> RtpReceiverInterface::GetSources() const {
+  return {};
+}
+
+int RtpReceiverInterface::AttachmentId() const {
+  return 0;
+}
+
+}  // namespace webrtc
diff --git a/api/rtpreceiverinterface.h b/api/rtpreceiverinterface.h
index ac2e090..017c95a 100644
--- a/api/rtpreceiverinterface.h
+++ b/api/rtpreceiverinterface.h
@@ -34,19 +34,16 @@
 class RtpSource {
  public:
   RtpSource() = delete;
-  RtpSource(int64_t timestamp_ms, uint32_t source_id, RtpSourceType source_type)
-      : timestamp_ms_(timestamp_ms),
-        source_id_(source_id),
-        source_type_(source_type) {}
-
+  RtpSource(int64_t timestamp_ms,
+            uint32_t source_id,
+            RtpSourceType source_type);
   RtpSource(int64_t timestamp_ms,
             uint32_t source_id,
             RtpSourceType source_type,
-            uint8_t audio_level)
-      : timestamp_ms_(timestamp_ms),
-        source_id_(source_id),
-        source_type_(source_type),
-        audio_level_(audio_level) {}
+            uint8_t audio_level);
+  RtpSource(const RtpSource&);
+  RtpSource& operator=(const RtpSource&);
+  ~RtpSource();
 
   int64_t timestamp_ms() const { return timestamp_ms_; }
   void update_timestamp_ms(int64_t timestamp_ms) {
@@ -98,10 +95,7 @@
   // the [[AssociatedRemoteMediaStreams]] internal slot in the spec.
   // https://w3c.github.io/webrtc-pc/#dfn-x%5B%5Bassociatedremotemediastreams%5D%5D
   // TODO(hbos): Make pure virtual as soon as Chromium's mock implements this.
-  virtual std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams()
-      const {
-    return std::vector<rtc::scoped_refptr<MediaStreamInterface>>();
-  }
+  virtual std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams() const;
 
   // Audio or video receiver?
   virtual cricket::MediaType media_type() const = 0;
@@ -124,19 +118,18 @@
   // TODO(zhihuang): Remove the default implementation once the subclasses
   // implement this. Currently, the only relevant subclass is the
   // content::FakeRtpReceiver in Chromium.
-  virtual std::vector<RtpSource> GetSources() const {
-    return std::vector<RtpSource>();
-  }
+  virtual std::vector<RtpSource> GetSources() const;
+
   // TODO(hta): Remove default implementation or move function to
   // an internal interface. content::FakeRtpReceiver in Chromium needs this.
 
   // Returns an ID that changes if the attached track changes, but
   // otherwise remains constant. Used to generate IDs for stats.
   // The special value zero means that no track is attached.
-  virtual int AttachmentId() const { return 0; }
+  virtual int AttachmentId() const;
 
  protected:
-  virtual ~RtpReceiverInterface() {}
+  ~RtpReceiverInterface() override = default;
 };
 
 // Define proxy for RtpReceiverInterface.
diff --git a/common_video/h264/sps_parser.cc b/common_video/h264/sps_parser.cc
index 1b9f0cd..2be6da2 100644
--- a/common_video/h264/sps_parser.cc
+++ b/common_video/h264/sps_parser.cc
@@ -26,6 +26,8 @@
 
 namespace webrtc {
 
+SpsParser::SpsState::SpsState() = default;
+
 // General note: this is based off the 02/2014 version of the H.264 standard.
 // You can find it on this page:
 // http://www.itu.int/rec/T-REC-H.264
diff --git a/common_video/h264/sps_parser.h b/common_video/h264/sps_parser.h
index 0ccc481..1fddc0c 100644
--- a/common_video/h264/sps_parser.h
+++ b/common_video/h264/sps_parser.h
@@ -25,7 +25,7 @@
   // The parsed state of the SPS. Only some select values are stored.
   // Add more as they are actually needed.
   struct SpsState {
-    SpsState() = default;
+    SpsState();
 
     uint32_t width = 0;
     uint32_t height = 0;
diff --git a/logging/BUILD.gn b/logging/BUILD.gn
index 95a5cac..d31086b 100644
--- a/logging/BUILD.gn
+++ b/logging/BUILD.gn
@@ -36,6 +36,7 @@
   sources = [
     "rtc_event_log/encoder/rtc_event_log_encoder.h",
     "rtc_event_log/events/rtc_event.h",
+    "rtc_event_log/rtc_event_log.cc",
     "rtc_event_log/rtc_event_log.h",
     "rtc_event_log/rtc_event_log_factory_interface.h",
   ]
diff --git a/logging/rtc_event_log/rtc_event_log.cc b/logging/rtc_event_log/rtc_event_log.cc
new file mode 100644
index 0000000..73a598d
--- /dev/null
+++ b/logging/rtc_event_log/rtc_event_log.cc
@@ -0,0 +1,21 @@
+/*
+ *  Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source
+ *  tree. An additional intellectual property rights grant can be found
+ *  in the file PATENTS.  All contributing project authors may
+ *  be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "logging/rtc_event_log/rtc_event_log.h"
+
+namespace webrtc {
+
+bool RtcEventLogNullImpl::StartLogging(
+    std::unique_ptr<RtcEventLogOutput> output,
+    int64_t output_period_ms) {
+  return false;
+}
+
+}  // namespace webrtc
diff --git a/logging/rtc_event_log/rtc_event_log.h b/logging/rtc_event_log/rtc_event_log.h
index 3a52480..79fd39a 100644
--- a/logging/rtc_event_log/rtc_event_log.h
+++ b/logging/rtc_event_log/rtc_event_log.h
@@ -57,9 +57,7 @@
 class RtcEventLogNullImpl : public RtcEventLog {
  public:
   bool StartLogging(std::unique_ptr<RtcEventLogOutput> output,
-                    int64_t output_period_ms) override {
-    return false;
-  }
+                    int64_t output_period_ms) override;
   void StopLogging() override {}
   void Log(std::unique_ptr<RtcEvent> event) override {}
 };
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
index fb9955a..68f3cb0 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
+++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.cc
@@ -34,6 +34,9 @@
   return ss.str();
 }
 
+Logging::ThreadState::ThreadState() = default;
+Logging::ThreadState::~ThreadState() = default;
+
 Logging::Context::Context(uint32_t name, int64_t timestamp_ms, bool enabled) {
   Logging::GetInstance()->PushState(ToString(name), timestamp_ms, enabled);
 }
@@ -205,6 +208,8 @@
     : thread_map_() {
 }
 
+Logging::~Logging() = default;
+
 Logging::State::State() : tag(""), timestamp_ms(0), enabled(true) {}
 
 Logging::State::State(const std::string& tag, int64_t timestamp_ms,
diff --git a/modules/remote_bitrate_estimator/test/bwe_test_logging.h b/modules/remote_bitrate_estimator/test/bwe_test_logging.h
index 325beb7..0f84249 100644
--- a/modules/remote_bitrate_estimator/test/bwe_test_logging.h
+++ b/modules/remote_bitrate_estimator/test/bwe_test_logging.h
@@ -331,12 +331,15 @@
     bool enabled;
   };
   struct ThreadState {
+    ThreadState();
+    ~ThreadState();
     State global_state;
     std::stack<State> stack;
   };
   typedef std::map<uint32_t, ThreadState> ThreadMap;
 
   Logging();
+  ~Logging();
   void PushState(const std::string& append_to_tag, int64_t timestamp_ms,
                  bool enabled);
   void PopState();
diff --git a/modules/rtp_rtcp/BUILD.gn b/modules/rtp_rtcp/BUILD.gn
index 24f3b75..799d646 100644
--- a/modules/rtp_rtcp/BUILD.gn
+++ b/modules/rtp_rtcp/BUILD.gn
@@ -185,11 +185,6 @@
     defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
   }
 
-  if (!build_with_chromium && is_clang) {
-    # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-  }
-
   deps = [
     ":rtp_rtcp_format",
     "..:module_api",
diff --git a/modules/rtp_rtcp/source/flexfec_sender.cc b/modules/rtp_rtcp/source/flexfec_sender.cc
index f046a34..28945ed 100644
--- a/modules/rtp_rtcp/source/flexfec_sender.cc
+++ b/modules/rtp_rtcp/source/flexfec_sender.cc
@@ -114,7 +114,7 @@
 std::vector<std::unique_ptr<RtpPacketToSend>> FlexfecSender::GetFecPackets() {
   std::vector<std::unique_ptr<RtpPacketToSend>> fec_packets_to_send;
   fec_packets_to_send.reserve(ulpfec_generator_.generated_fec_packets_.size());
-  for (const auto& fec_packet : ulpfec_generator_.generated_fec_packets_) {
+  for (const auto* fec_packet : ulpfec_generator_.generated_fec_packets_) {
     std::unique_ptr<RtpPacketToSend> fec_packet_to_send(
         new RtpPacketToSend(&rtp_header_extension_map_));
 
diff --git a/modules/rtp_rtcp/source/forward_error_correction.cc b/modules/rtp_rtcp/source/forward_error_correction.cc
index 33829c4..a00ecbb 100644
--- a/modules/rtp_rtcp/source/forward_error_correction.cc
+++ b/modules/rtp_rtcp/source/forward_error_correction.cc
@@ -655,7 +655,7 @@
         continue;
       }
 
-      auto recovered_packet_ptr = recovered_packet.get();
+      auto* recovered_packet_ptr = recovered_packet.get();
       // Add recovered packet to the list of recovered packets and update any
       // FEC packets covering this packet with a pointer to the data.
       // TODO(holmer): Consider replacing this with a binary search for the
diff --git a/modules/rtp_rtcp/source/packet_loss_stats.cc b/modules/rtp_rtcp/source/packet_loss_stats.cc
index 69c20c4..35184db 100644
--- a/modules/rtp_rtcp/source/packet_loss_stats.cc
+++ b/modules/rtp_rtcp/source/packet_loss_stats.cc
@@ -26,6 +26,8 @@
       multiple_loss_historic_packet_count_(0) {
 }
 
+PacketLossStats::~PacketLossStats() = default;
+
 void PacketLossStats::AddLostPacket(uint16_t sequence_number) {
   // Detect sequence number wrap around.
   if (!lost_packets_buffer_.empty() &&
@@ -77,7 +79,7 @@
   std::vector<const std::set<uint16_t>*> buffers;
   buffers.push_back(&lost_packets_buffer_);
   buffers.push_back(&lost_packets_wrapped_buffer_);
-  for (auto buffer : buffers) {
+  for (const auto* buffer : buffers) {
     for (auto it = buffer->begin(); it != buffer->end(); ++it) {
       uint16_t current_num = *it;
       if (sequential_count > 0 && current_num != ((last_num + 1) & 0xFFFF)) {
diff --git a/modules/rtp_rtcp/source/packet_loss_stats.h b/modules/rtp_rtcp/source/packet_loss_stats.h
index 683399f..7c4f658 100644
--- a/modules/rtp_rtcp/source/packet_loss_stats.h
+++ b/modules/rtp_rtcp/source/packet_loss_stats.h
@@ -21,7 +21,7 @@
 class PacketLossStats {
  public:
   PacketLossStats();
-  ~PacketLossStats() {}
+  ~PacketLossStats();
 
   // Adds a lost packet to the stats by sequence number.
   void AddLostPacket(uint16_t sequence_number);
diff --git a/modules/rtp_rtcp/source/receive_statistics_impl.cc b/modules/rtp_rtcp/source/receive_statistics_impl.cc
index 0e40aac..49d29f0 100644
--- a/modules/rtp_rtcp/source/receive_statistics_impl.cc
+++ b/modules/rtp_rtcp/source/receive_statistics_impl.cc
@@ -52,6 +52,8 @@
       rtcp_callback_(rtcp_callback),
       rtp_callback_(rtp_callback) {}
 
+StreamStatisticianImpl::~StreamStatisticianImpl() = default;
+
 void StreamStatisticianImpl::IncomingPacket(const RTPHeader& header,
                                             size_t packet_length,
                                             bool retransmitted) {
diff --git a/modules/rtp_rtcp/source/receive_statistics_impl.h b/modules/rtp_rtcp/source/receive_statistics_impl.h
index 1f827f6..d53787f 100644
--- a/modules/rtp_rtcp/source/receive_statistics_impl.h
+++ b/modules/rtp_rtcp/source/receive_statistics_impl.h
@@ -29,7 +29,7 @@
                          Clock* clock,
                          RtcpStatisticsCallback* rtcp_callback,
                          StreamDataCountersCallback* rtp_callback);
-  virtual ~StreamStatisticianImpl() {}
+  ~StreamStatisticianImpl() override;
 
   // |reset| here and in next method restarts calculation of fraction_lost stat.
   bool GetStatistics(RtcpStatistics* statistics, bool reset) override;
@@ -96,7 +96,7 @@
  public:
   explicit ReceiveStatisticsImpl(Clock* clock);
 
-  ~ReceiveStatisticsImpl();
+  ~ReceiveStatisticsImpl() override;
 
   // Implement ReceiveStatisticsProvider.
   std::vector<rtcp::ReportBlock> RtcpReportBlocks(size_t max_blocks) override;
diff --git a/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc b/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc
index 444ba68..e524aea 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc
+++ b/modules/rtp_rtcp/source/rtcp_packet/sender_report.cc
@@ -21,6 +21,7 @@
 namespace rtcp {
 constexpr uint8_t SenderReport::kPacketType;
 constexpr size_t SenderReport::kMaxNumberOfReportBlocks;
+constexpr size_t SenderReport::kSenderBaseLength;
 //    Sender report (SR) (RFC 3550).
 //     0                   1                   2                   3
 //     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
@@ -46,6 +47,10 @@
       sender_packet_count_(0),
       sender_octet_count_(0) {}
 
+SenderReport::SenderReport(const SenderReport&) = default;
+SenderReport::SenderReport(SenderReport&&) = default;
+SenderReport& SenderReport::operator=(const SenderReport&) = default;
+SenderReport& SenderReport::operator=(SenderReport&&) = default;
 SenderReport::~SenderReport() = default;
 
 bool SenderReport::Parse(const CommonHeader& packet) {
diff --git a/modules/rtp_rtcp/source/rtcp_packet/sender_report.h b/modules/rtp_rtcp/source/rtcp_packet/sender_report.h
index 844459a..f1ee525 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/sender_report.h
+++ b/modules/rtp_rtcp/source/rtcp_packet/sender_report.h
@@ -27,6 +27,10 @@
   static constexpr size_t kMaxNumberOfReportBlocks = 0x1f;
 
   SenderReport();
+  SenderReport(const SenderReport&);
+  SenderReport(SenderReport&&);
+  SenderReport& operator=(const SenderReport&);
+  SenderReport& operator=(SenderReport&&);
   ~SenderReport() override;
 
   // Parse assumes header is already parsed and validated.
@@ -65,7 +69,7 @@
               PacketReadyCallback callback) const override;
 
  private:
-  const size_t kSenderBaseLength = 24;
+  static constexpr size_t kSenderBaseLength = 24;
 
   uint32_t sender_ssrc_;
   NtpTime ntp_;
diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc
index d45a86f..415de95 100644
--- a/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -92,7 +92,7 @@
  public:
   PacketContainer(Transport* transport, RtcEventLog* event_log)
       : transport_(transport), event_log_(event_log) {}
-  virtual ~PacketContainer() {
+  ~PacketContainer() override {
     for (RtcpPacket* packet : appended_packets_)
       delete packet;
   }
diff --git a/modules/rtp_rtcp/source/rtp_format_h264.cc b/modules/rtp_rtcp/source/rtp_format_h264.cc
index 226cc36..0223402 100644
--- a/modules/rtp_rtcp/source/rtp_format_h264.cc
+++ b/modules/rtp_rtcp/source/rtp_format_h264.cc
@@ -95,6 +95,8 @@
 RtpPacketizerH264::~RtpPacketizerH264() {
 }
 
+RtpPacketizerH264::Fragment::~Fragment() = default;
+
 RtpPacketizerH264::Fragment::Fragment(const uint8_t* buffer, size_t length)
     : buffer(buffer), length(length) {}
 RtpPacketizerH264::Fragment::Fragment(const Fragment& fragment)
diff --git a/modules/rtp_rtcp/source/rtp_format_h264.h b/modules/rtp_rtcp/source/rtp_format_h264.h
index 5b6fe02..04612b7 100644
--- a/modules/rtp_rtcp/source/rtp_format_h264.h
+++ b/modules/rtp_rtcp/source/rtp_format_h264.h
@@ -30,7 +30,7 @@
                     size_t last_packet_reduction_len,
                     H264PacketizationMode packetization_mode);
 
-  virtual ~RtpPacketizerH264();
+  ~RtpPacketizerH264() override;
 
   size_t SetPayloadData(const uint8_t* payload_data,
                         size_t payload_size,
@@ -49,6 +49,7 @@
   struct Fragment {
     Fragment(const uint8_t* buffer, size_t length);
     explicit Fragment(const Fragment& fragment);
+    ~Fragment();
     const uint8_t* buffer = nullptr;
     size_t length = 0;
     std::unique_ptr<rtc::Buffer> tmp_buffer;
@@ -100,7 +101,7 @@
 class RtpDepacketizerH264 : public RtpDepacketizer {
  public:
   RtpDepacketizerH264();
-  virtual ~RtpDepacketizerH264();
+  ~RtpDepacketizerH264() override;
 
   bool Parse(ParsedPayload* parsed_payload,
              const uint8_t* payload_data,
diff --git a/modules/rtp_rtcp/source/rtp_format_video_generic.cc b/modules/rtp_rtcp/source/rtp_format_video_generic.cc
index 0c9bb43..1d3c615 100644
--- a/modules/rtp_rtcp/source/rtp_format_video_generic.cc
+++ b/modules/rtp_rtcp/source/rtp_format_video_generic.cc
@@ -112,6 +112,8 @@
   return "RtpPacketizerGeneric";
 }
 
+RtpDepacketizerGeneric::~RtpDepacketizerGeneric() = default;
+
 bool RtpDepacketizerGeneric::Parse(ParsedPayload* parsed_payload,
                                    const uint8_t* payload_data,
                                    size_t payload_data_length) {
diff --git a/modules/rtp_rtcp/source/rtp_format_video_generic.h b/modules/rtp_rtcp/source/rtp_format_video_generic.h
index a9da5da..9a916bf 100644
--- a/modules/rtp_rtcp/source/rtp_format_video_generic.h
+++ b/modules/rtp_rtcp/source/rtp_format_video_generic.h
@@ -31,7 +31,7 @@
                        size_t max_payload_len,
                        size_t last_packet_reduction_len);
 
-  virtual ~RtpPacketizerGeneric();
+  ~RtpPacketizerGeneric() override;
 
   // Returns total number of packets to be generated.
   size_t SetPayloadData(const uint8_t* payload_data,
@@ -64,7 +64,7 @@
 // Depacketizer for generic codec.
 class RtpDepacketizerGeneric : public RtpDepacketizer {
  public:
-  virtual ~RtpDepacketizerGeneric() {}
+  ~RtpDepacketizerGeneric() override;
 
   bool Parse(ParsedPayload* parsed_payload,
              const uint8_t* payload_data,
diff --git a/modules/rtp_rtcp/source/rtp_format_vp8.h b/modules/rtp_rtcp/source/rtp_format_vp8.h
index 8930864..7697480 100644
--- a/modules/rtp_rtcp/source/rtp_format_vp8.h
+++ b/modules/rtp_rtcp/source/rtp_format_vp8.h
@@ -45,7 +45,7 @@
                    size_t max_payload_len,
                    size_t last_packet_reduction_len);
 
-  virtual ~RtpPacketizerVp8();
+  ~RtpPacketizerVp8() override;
 
   size_t SetPayloadData(const uint8_t* payload_data,
                         size_t payload_size,
@@ -159,7 +159,7 @@
 // Depacketizer for VP8.
 class RtpDepacketizerVp8 : public RtpDepacketizer {
  public:
-  virtual ~RtpDepacketizerVp8() {}
+  ~RtpDepacketizerVp8() override = default;
 
   bool Parse(ParsedPayload* parsed_payload,
              const uint8_t* payload_data,
diff --git a/modules/rtp_rtcp/source/rtp_format_vp9.h b/modules/rtp_rtcp/source/rtp_format_vp9.h
index aa86ccd..0171977 100644
--- a/modules/rtp_rtcp/source/rtp_format_vp9.h
+++ b/modules/rtp_rtcp/source/rtp_format_vp9.h
@@ -37,7 +37,7 @@
                    size_t max_payload_length,
                    size_t last_packet_reduction_len);
 
-  virtual ~RtpPacketizerVp9();
+  ~RtpPacketizerVp9() override;
 
   std::string ToString() override;
 
@@ -90,7 +90,7 @@
 
 class RtpDepacketizerVp9 : public RtpDepacketizer {
  public:
-  virtual ~RtpDepacketizerVp9() {}
+  ~RtpDepacketizerVp9() override = default;
 
   bool Parse(ParsedPayload* parsed_payload,
              const uint8_t* payload,
diff --git a/modules/rtp_rtcp/source/rtp_header_parser.cc b/modules/rtp_rtcp/source/rtp_header_parser.cc
index 5d2971a..df68f74 100644
--- a/modules/rtp_rtcp/source/rtp_header_parser.cc
+++ b/modules/rtp_rtcp/source/rtp_header_parser.cc
@@ -18,7 +18,7 @@
 class RtpHeaderParserImpl : public RtpHeaderParser {
  public:
   RtpHeaderParserImpl();
-  virtual ~RtpHeaderParserImpl() {}
+  ~RtpHeaderParserImpl() override = default;
 
   bool Parse(const uint8_t* packet,
              size_t length,
diff --git a/modules/rtp_rtcp/source/rtp_packet_history.cc b/modules/rtp_rtcp/source/rtp_packet_history.cc
index 887406a..b3649f8 100644
--- a/modules/rtp_rtcp/source/rtp_packet_history.cc
+++ b/modules/rtp_rtcp/source/rtp_packet_history.cc
@@ -29,6 +29,12 @@
 }  // namespace
 constexpr size_t RtpPacketHistory::kMaxCapacity;
 
+RtpPacketHistory::StoredPacket::StoredPacket() = default;
+RtpPacketHistory::StoredPacket::StoredPacket(StoredPacket&&) = default;
+RtpPacketHistory::StoredPacket& RtpPacketHistory::StoredPacket::operator=(
+    RtpPacketHistory::StoredPacket&&) = default;
+RtpPacketHistory::StoredPacket::~StoredPacket() = default;
+
 RtpPacketHistory::RtpPacketHistory(Clock* clock)
     : clock_(clock), store_(false), prev_index_(0), rtt_ms_(-1) {}
 
diff --git a/modules/rtp_rtcp/source/rtp_packet_history.h b/modules/rtp_rtcp/source/rtp_packet_history.h
index 91134bf..e9d5808 100644
--- a/modules/rtp_rtcp/source/rtp_packet_history.h
+++ b/modules/rtp_rtcp/source/rtp_packet_history.h
@@ -60,6 +60,10 @@
 
  private:
   struct StoredPacket {
+    StoredPacket();
+    StoredPacket(StoredPacket&&);
+    StoredPacket& operator=(StoredPacket&&);
+    ~StoredPacket();
     uint16_t sequence_number = 0;
     int64_t send_time = 0;
     StorageType storage_type = kDontRetransmit;
diff --git a/modules/rtp_rtcp/source/rtp_receiver_audio.cc b/modules/rtp_rtcp/source/rtp_receiver_audio.cc
index 270c00d..4f79295 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_audio.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_audio.cc
@@ -38,6 +38,8 @@
   memset(current_remote_energy_, 0, sizeof(current_remote_energy_));
 }
 
+RTPReceiverAudio::~RTPReceiverAudio() = default;
+
 // Outband TelephoneEvent(DTMF) detection
 void RTPReceiverAudio::SetTelephoneEventForwardToDecoder(
     bool forward_to_decoder) {
@@ -57,6 +59,10 @@
   return telephone_event_payload_type_ == payload_type;
 }
 
+TelephoneEventHandler* RTPReceiverAudio::GetTelephoneEventHandler() {
+  return this;
+}
+
 bool RTPReceiverAudio::CNGPayloadType(int8_t payload_type) {
   rtc::CritScope lock(&crit_sect_);
   return payload_type == cng_nb_payload_type_ ||
diff --git a/modules/rtp_rtcp/source/rtp_receiver_audio.h b/modules/rtp_rtcp/source/rtp_receiver_audio.h
index b031002..a211223 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_audio.h
+++ b/modules/rtp_rtcp/source/rtp_receiver_audio.h
@@ -27,7 +27,7 @@
                          public TelephoneEventHandler {
  public:
   explicit RTPReceiverAudio(RtpData* data_callback);
-  virtual ~RTPReceiverAudio() {}
+  ~RTPReceiverAudio() override;
 
   // The following three methods implement the TelephoneEventHandler interface.
   // Forward DTMFs to decoder for playout.
@@ -39,7 +39,7 @@
   // Is TelephoneEvent configured with |payload_type|.
   bool TelephoneEventPayloadType(const int8_t payload_type) const override;
 
-  TelephoneEventHandler* GetTelephoneEventHandler() override { return this; }
+  TelephoneEventHandler* GetTelephoneEventHandler() override;
 
   // Returns true if CNG is configured with |payload_type|.
   bool CNGPayloadType(const int8_t payload_type);
diff --git a/modules/rtp_rtcp/source/rtp_receiver_impl.h b/modules/rtp_rtcp/source/rtp_receiver_impl.h
index cd6b619..d41e403 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_impl.h
+++ b/modules/rtp_rtcp/source/rtp_receiver_impl.h
@@ -35,7 +35,7 @@
                   RTPPayloadRegistry* rtp_payload_registry,
                   RTPReceiverStrategy* rtp_media_receiver);
 
-  virtual ~RtpReceiverImpl();
+  ~RtpReceiverImpl() override;
 
   int32_t RegisterReceivePayload(int payload_type,
                                  const SdpAudioFormat& audio_format) override;
diff --git a/modules/rtp_rtcp/source/rtp_receiver_strategy.cc b/modules/rtp_rtcp/source/rtp_receiver_strategy.cc
index 6db24c9..b5a6356e 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_strategy.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_strategy.cc
@@ -17,6 +17,8 @@
 RTPReceiverStrategy::RTPReceiverStrategy(RtpData* data_callback)
     : data_callback_(data_callback) {}
 
+RTPReceiverStrategy::~RTPReceiverStrategy() = default;
+
 void RTPReceiverStrategy::GetLastMediaSpecificPayload(
     PayloadUnion* payload) const {
   rtc::CritScope cs(&crit_sect_);
diff --git a/modules/rtp_rtcp/source/rtp_receiver_strategy.h b/modules/rtp_rtcp/source/rtp_receiver_strategy.h
index 3288329..24c05f1 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_strategy.h
+++ b/modules/rtp_rtcp/source/rtp_receiver_strategy.h
@@ -30,7 +30,7 @@
   static RTPReceiverStrategy* CreateVideoStrategy(RtpData* data_callback);
   static RTPReceiverStrategy* CreateAudioStrategy(RtpData* data_callback);
 
-  virtual ~RTPReceiverStrategy() {}
+  virtual ~RTPReceiverStrategy();
 
   // Parses the RTP packet and calls the data callback with the payload data.
   // Implementations are encouraged to use the provided packet buffer and RTP
diff --git a/modules/rtp_rtcp/source/rtp_receiver_video.cc b/modules/rtp_rtcp/source/rtp_receiver_video.cc
index 65d1831..d8117b5 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_video.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_video.cc
@@ -119,6 +119,10 @@
              : -1;
 }
 
+TelephoneEventHandler* RTPReceiverVideo::GetTelephoneEventHandler() {
+  return nullptr;
+}
+
 RTPAliveType RTPReceiverVideo::ProcessDeadOrAlive(
     uint16_t last_payload_length) const {
   return kRtpDead;
diff --git a/modules/rtp_rtcp/source/rtp_receiver_video.h b/modules/rtp_rtcp/source/rtp_receiver_video.h
index f1e14f4d..bebae0a 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_video.h
+++ b/modules/rtp_rtcp/source/rtp_receiver_video.h
@@ -23,7 +23,7 @@
  public:
   explicit RTPReceiverVideo(RtpData* data_callback);
 
-  virtual ~RTPReceiverVideo();
+  ~RTPReceiverVideo() override;
 
   int32_t ParseRtpPacket(WebRtcRTPHeader* rtp_header,
                          const PayloadUnion& specific_payload,
@@ -32,7 +32,7 @@
                          size_t packet_length,
                          int64_t timestamp) override;
 
-  TelephoneEventHandler* GetTelephoneEventHandler() override { return NULL; }
+  TelephoneEventHandler* GetTelephoneEventHandler() override;
 
   RTPAliveType ProcessDeadOrAlive(uint16_t last_payload_length) const override;
 
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index 27bf5b4..7707813 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -142,6 +142,8 @@
   SetMaxRtpPacketSize(IP_PACKET_SIZE - kTcpOverIpv4HeaderSize);
 }
 
+ModuleRtpRtcpImpl::~ModuleRtpRtcpImpl() = default;
+
 // Returns the number of milliseconds until the module want a worker thread
 // to call Process.
 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() {
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/modules/rtp_rtcp/source/rtp_rtcp_impl.h
index 0bb9ede..fffce81 100644
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.h
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.h
@@ -31,6 +31,7 @@
 class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp {
  public:
   explicit ModuleRtpRtcpImpl(const RtpRtcp::Configuration& configuration);
+  ~ModuleRtpRtcpImpl() override;
 
   // Returns the number of milliseconds until the module want a worker thread to
   // call Process.
diff --git a/modules/rtp_rtcp/source/ulpfec_generator.cc b/modules/rtp_rtcp/source/ulpfec_generator.cc
index 3432bdd..85000ea 100644
--- a/modules/rtp_rtcp/source/ulpfec_generator.cc
+++ b/modules/rtp_rtcp/source/ulpfec_generator.cc
@@ -62,6 +62,8 @@
 RedPacket::RedPacket(size_t length)
     : data_(new uint8_t[length]), length_(length), header_length_(0) {}
 
+RedPacket::~RedPacket() = default;
+
 void RedPacket::CreateHeader(const uint8_t* rtp_header,
                              size_t header_length,
                              int red_payload_type,
@@ -213,7 +215,7 @@
   ForwardErrorCorrection::Packet* last_media_packet =
       media_packets_.back().get();
   uint16_t seq_num = first_seq_num;
-  for (const auto& fec_packet : generated_fec_packets_) {
+  for (const auto* fec_packet : generated_fec_packets_) {
     // Wrap FEC packet (including FEC headers) in a RED packet. Since the
     // FEC packets in |generated_fec_packets_| don't have RTP headers, we
     // reuse the header from the last media packet.
diff --git a/modules/rtp_rtcp/source/ulpfec_generator.h b/modules/rtp_rtcp/source/ulpfec_generator.h
index 639c15b..efc753f 100644
--- a/modules/rtp_rtcp/source/ulpfec_generator.h
+++ b/modules/rtp_rtcp/source/ulpfec_generator.h
@@ -24,6 +24,7 @@
 class RedPacket {
  public:
   explicit RedPacket(size_t length);
+  ~RedPacket();
 
   void CreateHeader(const uint8_t* rtp_header,
                     size_t header_length,
diff --git a/modules/rtp_rtcp/source/ulpfec_receiver_impl.h b/modules/rtp_rtcp/source/ulpfec_receiver_impl.h
index edc3d31..7dbc7dd 100644
--- a/modules/rtp_rtcp/source/ulpfec_receiver_impl.h
+++ b/modules/rtp_rtcp/source/ulpfec_receiver_impl.h
@@ -25,7 +25,7 @@
 class UlpfecReceiverImpl : public UlpfecReceiver {
  public:
   explicit UlpfecReceiverImpl(uint32_t ssrc, RecoveredPacketReceiver* callback);
-  virtual ~UlpfecReceiverImpl();
+  ~UlpfecReceiverImpl() override;
 
   int32_t AddReceivedRedPacket(const RTPHeader& rtp_header,
                                const uint8_t* incoming_rtp_packet,