Commit 23015f6
fix build: make parse constexpr for new fmt
fmt v11+ uses consteval format string validation (fstring) which requires fmt::formatter::parse() to be a constant expression. The non-constexpr parse() methods in protobuf test utils caused compile errors like:
error: call to consteval function 'fmt::fstring<...>' is not a constant expression
note: non-constexpr function 'parse' cannot be used in a constant expression
Make all 4 parse() methods constexpr and simplify them to return ctx.begin(), matching the existing pattern in http_method.hpp and sockaddr.hpp. The removed runtime throw guard is no longer needed — fmt's compile-time checker now catches invalid format specs at compile time with "unknown format specifier" error.
---
Pull Request resolved: #1287
commit_hash:bf12ac2b1ab5e631543ee9fc697535c67c4e19fe1 parent c20e8c8 commit 23015f6
1 file changed
Lines changed: 4 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 57 | + | |
64 | 58 | | |
65 | 59 | | |
66 | 60 | | |
| |||
79 | 73 | | |
80 | 74 | | |
81 | 75 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 76 | + | |
89 | 77 | | |
90 | 78 | | |
91 | 79 | | |
| |||
101 | 89 | | |
102 | 90 | | |
103 | 91 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 92 | + | |
111 | 93 | | |
112 | 94 | | |
113 | 95 | | |
| |||
123 | 105 | | |
124 | 106 | | |
125 | 107 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 108 | + | |
133 | 109 | | |
134 | 110 | | |
135 | 111 | | |
| |||
0 commit comments