Skip to content

Commit 9291eee

Browse files
committed
Replace std::clamp in pixelCPEforDevice.h
1 parent 04aa605 commit 9291eee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,11 @@ namespace pixelCPEforDevice {
379379
int high_value = kNumErrorBins - 1;
380380
int bin_value = float(kNumErrorBins) * (cp.xpos[ic] + xoff) / (2 * xoff);
381381
// return estimated bin value truncated to [0, 15]
382-
int jx = std::clamp(bin_value, low_value, high_value);
382+
// Equivalent of jx = std::clamp(bin_value, low_value, high_value)
383+
// which doesn't compile with gcc14 due to reference to __glibcxx_assert
384+
// See https://github.com/llvm/llvm-project/issues/95183
385+
int tmp_max = std::max<int>(bin_value, low_value);
386+
int jx = std::min<int>(tmp_max, high_value);
383387

384388
auto toCM = [](uint8_t x) { return float(x) * 1.e-4f; };
385389

0 commit comments

Comments
 (0)