Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit eedced8

Browse files
authored
A workaround for MSVC internal compiler error. (#179)
MSVC reports fatal error C1001: Internal compiler error for Metric::TimeSeries::Sample's designated initialisation.
1 parent 95fd35c commit eedced8

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

api/test/metrics/metrics_logger.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ void DefaultMetricsLogger::LogSingleValueMetric(
4949
.improvement_direction = improvement_direction,
5050
.test_case = std::string(test_case_name),
5151
.metric_metadata = std::move(metadata),
52+
#ifndef _MSC_VER
5253
.time_series =
5354
Metric::TimeSeries{.samples = std::vector{Metric::TimeSeries::Sample{
5455
.timestamp = Now(), .value = value}}},
56+
#endif
5557
.stats = Metric::Stats{
5658
.mean = value, .stddev = absl::nullopt, .min = value, .max = value}});
5759
}

api/test/metrics/metrics_logger_and_exporter.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ void MetricsLoggerAndExporter::LogSingleValueMetric(
6161
.improvement_direction = improvement_direction,
6262
.test_case = std::string(test_case_name),
6363
.metric_metadata = std::move(metadata),
64+
#ifndef _MSC_VER
6465
.time_series =
6566
Metric::TimeSeries{.samples = std::vector{Metric::TimeSeries::Sample{
6667
.timestamp = Now(), .value = value}}},
68+
#endif
6769
.stats = Metric::Stats{
6870
.mean = value, .stddev = absl::nullopt, .min = value, .max = value}});
6971
}

0 commit comments

Comments
 (0)