Mark static const class/struct members as constexpr.

This change fixes declarations that have initial values but are
technically not definitions by marking them constexpr (which counts as a
definition).

Bug: None
Change-Id: Icbecf8d83faffa83b9f7e1ffe4d6ef3a3f0b0c2a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173587
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31073}
This commit is contained in:
Mirko Bonadei 2020-04-15 09:55:03 +02:00 committed by Commit Bot
parent 3ebb6e93f4
commit f7f6870f1b
3 changed files with 3 additions and 3 deletions

View file

@ -969,7 +969,7 @@ class PosixSignalHandler {
// POSIX only specifies 32 signals, but in principle the system might have
// more and the programmer might choose to use them, so we size our array
// for 128.
static const int kNumPosixSignals = 128;
static constexpr int kNumPosixSignals = 128;
// There is just a single global instance. (Signal handlers do not get any
// sort of user-defined void * parameter, so they can't access anything that

View file

@ -73,7 +73,7 @@ class RTCCertificateGeneratorTest : public ::testing::Test {
: fixture_(new RefCountedObject<RTCCertificateGeneratorFixture>()) {}
protected:
static const int kGenerationTimeoutMs = 10000;
static constexpr int kGenerationTimeoutMs = 10000;
scoped_refptr<RTCCertificateGeneratorFixture> fixture_;
};

View file

@ -791,7 +791,7 @@ class GuardedAsyncInvokeTest : public ::testing::Test {
}
protected:
const static int kWaitTimeout = 1000;
constexpr static int kWaitTimeout = 1000;
GuardedAsyncInvokeTest() : int_value_(0), expected_thread_(nullptr) {}
int int_value_;