CARVIEW |
Select Language
HTTP/2 200
date: Fri, 18 Jul 2025 00:59:58 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/catchorg/Catch2.git
etag: W/"5fdf4fae0773464bb4f49235011493b0"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=2QUV2rVCGm59W5qWV4HApi7jcQ7eiuvRiOgeez9pV79XOBjhvRPGHKpiXQMlcm4rycdHUE%2F9JbDtfX%2FuDqKB5qujp4UhQ2F6lWZG92cum6N8f%2B8R1Oko7T%2BcYopzmHd1svPzrIm%2FA75ksd1ttX66J%2B431N4m5OMuVMbauHYqQuldjoQ9DHDhHtqOmY87EM5kKdhEjcZO4IzwN4es0ZIVUva8jT8D8gquX78RPTEsYA0GR%2BM8DFkFSU%2F6HpAskO%2FcU3bRvEMW9Uy03OeJ7EREvg%3D%3D--ufmtz7I4piZHqhFo--IXBSKiGwQ3nb1pKPFxn%2BoA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1460716020.1752800397; Path=/; Domain=github.com; Expires=Sat, 18 Jul 2026 00:59:57 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sat, 18 Jul 2026 00:59:57 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: CA44:2B4B5A:5E8B2C:76263B:68799C8D
Support literal-zero detectors using consteval int constructors · catchorg/Catch2@dc51386 · GitHub
Copy file name to clipboardExpand all lines: src/catch2/internal/catch_compiler_capabilities.hpp
Copy file name to clipboardExpand all lines: src/catch2/internal/catch_decomposer.cpp
Copy file name to clipboardExpand all lines: src/catch2/internal/catch_decomposer.hpp
Copy file name to clipboardExpand all lines: tests/SelfTest/UsageTests/Compilation.tests.cpp
Copy file name to clipboardExpand all lines: tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit dc51386
committed
Support literal-zero detectors using consteval int constructors
This was originally motivated by `REQUIRE((a <=> b) == 0)` no
longer compiling using MSVC. After some investigation, I found
that they changed their implementation of the zero literal
detector from the previous pointer-constructor with deleted
other constructors, into one that uses `consteval` constructor
from int.
This breaks the previous detection logic, because now
`is_foo_comparable<std::strong_ordering, int>` is true, but
actually trying to compare them is a compile-time error...
The solution was to make the decomposition `constexpr` and rely
on a late C++20 DR that makes it so that `consteval` propagates
up through the callstack of `constexpr` functions, until it either
runs out of `constexpr` functions, or succeeds.
However, the default handling of types in decomposition is to
take a reference to them. This reference never becomes dangling,
but because the constexpr evaluation engine cannot prove this,
decomposition paths taking references to objects cannot be
actually evaluated at compilation time. Thankfully we already
did have a value-oriented decomposition path for arithmetic types
(as these are common linkage-less types), so we could just
explicitly spell out the `std::foo_ordering` types as also being
supposed to be decomposed by-value.
Two more fun facts about these changes
1) The original motivation of the MSVC change was to avoid
trigering a `Wzero-as-null-pointer-constant` warning. I still
do not believe this was a good decision.
2) Current latest version of MSVC does not actually implement the
aforementioned C++20 DR, so even with this commit, MSVC cannot
compile `REQUIRE((a <=> b) == 0)`.1 parent bbba3d8 commit dc51386Copy full SHA for dc51386
File tree
Expand file treeCollapse file tree
5 files changed
+154
-41
lines changedFilter options
- src/catch2/internal
- tests/SelfTest
- UsageTests
- helpers
Expand file treeCollapse file tree
5 files changed
+154
-41
lines changedsrc/catch2/internal/catch_compiler_capabilities.hpp
Copy file name to clipboardExpand all lines: src/catch2/internal/catch_compiler_capabilities.hpp+4Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 |
| |
41 | 45 |
| |
42 | 46 |
| |
|
src/catch2/internal/catch_decomposer.cpp
Copy file name to clipboardExpand all lines: src/catch2/internal/catch_decomposer.cpp+6-1Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 |
| |
15 | 20 |
| |
16 | 21 |
| |
|
src/catch2/internal/catch_decomposer.hpp
Copy file name to clipboardExpand all lines: src/catch2/internal/catch_decomposer.hpp+61-29Lines changed: 61 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| 16 | + | |
16 | 17 |
| |
17 | 18 |
| |
18 | 19 |
| |
| |||
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
37 | 46 |
| |
38 | 47 |
| |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
39 | 65 |
| |
40 | 66 |
| |
41 | 67 |
| |
| |||
44 | 70 |
| |
45 | 71 |
| |
46 | 72 |
| |
47 |
| - | |
48 |
| - | |
49 |
| - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
50 | 77 |
| |
51 |
| - | |
| 78 | + | |
52 | 79 |
| |
53 | 80 |
| |
54 | 81 |
| |
| |||
59 | 86 |
| |
60 | 87 |
| |
61 | 88 |
| |
62 |
| - | |
| 89 | + | |
63 | 90 |
| |
64 | 91 |
| |
65 | 92 |
| |
| |||
81 | 108 |
| |
82 | 109 |
| |
83 | 110 |
| |
84 |
| - | |
| 111 | + | |
85 | 112 |
| |
86 | 113 |
| |
87 | 114 |
| |
| |||
154 | 181 |
| |
155 | 182 |
| |
156 | 183 |
| |
157 |
| - | |
| 184 | + | |
158 | 185 |
| |
159 | 186 |
| |
160 | 187 |
| |
| |||
165 | 192 |
| |
166 | 193 |
| |
167 | 194 |
| |
168 |
| - | |
| 195 | + | |
169 | 196 |
| |
170 | 197 |
| |
171 | 198 |
| |
172 |
| - | |
| 199 | + | |
173 | 200 |
| |
174 | 201 |
| |
175 |
| - | |
| 202 | + | |
176 | 203 |
| |
177 | 204 |
| |
178 | 205 |
| |
179 | 206 |
| |
180 | 207 |
| |
181 | 208 |
| |
182 |
| - | |
| 209 | + | |
183 | 210 |
| |
184 | 211 |
| |
185 |
| - | |
| 212 | + | |
186 | 213 |
| |
187 | 214 |
| |
188 | 215 |
| |
189 | 216 |
| |
190 | 217 |
| |
191 |
| - | |
| 218 | + | |
192 | 219 |
| |
193 | 220 |
| |
194 | 221 |
| |
| |||
202 | 229 |
| |
203 | 230 |
| |
204 | 231 |
| |
205 |
| - | |
| 232 | + | |
206 | 233 |
| |
207 | 234 |
| |
208 | 235 |
| |
| |||
220 | 247 |
| |
221 | 248 |
| |
222 | 249 |
| |
| 250 | + | |
223 | 251 |
| |
224 | 252 |
| |
225 |
| - | |
| 253 | + | |
226 | 254 |
| |
227 | 255 |
| |
228 |
| - | |
| 256 | + | |
229 | 257 |
| |
230 | 258 |
| |
231 | 259 |
| |
232 | 260 |
| |
233 | 261 |
| |
234 | 262 |
| |
235 |
| - | |
| 263 | + | |
236 | 264 |
| |
237 | 265 |
| |
238 |
| - | |
| 266 | + | |
239 | 267 |
| |
240 | 268 |
| |
241 | 269 |
| |
242 | 270 |
| |
243 | 271 |
| |
244 |
| - | |
| 272 | + | |
245 | 273 |
| |
246 | 274 |
| |
247 | 275 |
| |
| |||
253 | 281 |
| |
254 | 282 |
| |
255 | 283 |
| |
256 |
| - | |
| 284 | + | |
257 | 285 |
| |
258 | 286 |
| |
259 | 287 |
| |
| |||
274 | 302 |
| |
275 | 303 |
| |
276 | 304 |
| |
277 |
| - | |
| 305 | + | |
278 | 306 |
| |
279 |
| - | |
| 307 | + | |
280 | 308 |
| |
281 | 309 |
| |
282 | 310 |
| |
283 | 311 |
| |
284 | 312 |
| |
285 |
| - | |
286 |
| - | |
| 313 | + | |
| 314 | + | |
287 | 315 |
| |
288 | 316 |
| |
289 | 317 |
| |
| |||
309 | 337 |
| |
310 | 338 |
| |
311 | 339 |
| |
312 |
| - | |
| 340 | + | |
313 | 341 |
| |
314 | 342 |
| |
315 | 343 |
| |
316 | 344 |
| |
317 | 345 |
| |
318 |
| - | |
319 |
| - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
320 | 351 |
| |
321 | 352 |
| |
322 | 353 |
| |
323 |
| - | |
324 |
| - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
325 | 357 |
| |
326 | 358 |
| |
327 | 359 |
| |
|
tests/SelfTest/UsageTests/Compilation.tests.cpp
Copy file name to clipboardExpand all lines: tests/SelfTest/UsageTests/Compilation.tests.cpp+69-2Lines changed: 69 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
313 | 313 |
| |
314 | 314 |
| |
315 | 315 |
| |
316 |
| - | |
| 316 | + | |
| 317 | + | |
317 | 318 |
| |
318 | 319 |
| |
319 | 320 |
| |
320 |
| - | |
| 321 | + | |
321 | 322 |
| |
322 | 323 |
| |
323 | 324 |
| |
| |||
330 | 331 |
| |
331 | 332 |
| |
332 | 333 |
| |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
333 | 400 |
| |
334 | 401 |
| |
335 | 402 |
| |
|
tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp
Copy file name to clipboardExpand all lines: tests/SelfTest/helpers/type_with_lit_0_comparisons.hpp+14-9Lines changed: 14 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| 15 | + | |
| 16 | + | |
15 | 17 |
| |
16 | 18 |
| |
17 |
| - | |
18 |
| - | |
| 19 | + | |
| 20 | + | |
19 | 21 |
| |
20 | 22 |
| |
21 | 23 |
| |
22 |
| - | |
| 24 | + | |
23 | 25 |
| |
24 | 26 |
| |
| 27 | + | |
25 | 28 |
| |
26 |
| - | |
27 |
| - | |
28 |
| - | |
29 |
| - | |
30 |
| - | |
31 |
| - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 |
| |
33 | 38 |
| |
34 | 39 |
| |
|
You can’t perform that action at this time.
0 commit comments