File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1377,7 +1377,15 @@ inline namespace literals {
1377
1377
/* * \rst
1378
1378
String literal version of `arg`
1379
1379
\endrst */
1380
- constexpr arg operator " " _a(const char *name, size_t ) { return arg (name); }
1380
+ constexpr arg
1381
+ #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 5
1382
+ operator " " _a // gcc 4.8.5 insists on having a space (hard error).
1383
+ #else
1384
+ operator " " _a // clang 17 generates a deprecation warning if there is a space.
1385
+ #endif
1386
+ (const char *name, size_t ) {
1387
+ return arg (name);
1388
+ }
1381
1389
} // namespace literals
1382
1390
1383
1391
PYBIND11_NAMESPACE_BEGIN (detail)
Original file line number Diff line number Diff line change @@ -1612,7 +1612,15 @@ inline namespace literals {
1612
1612
/* * \rst
1613
1613
String literal version of `str`
1614
1614
\endrst */
1615
- inline str operator " " _s(const char *s, size_t size) { return {s, size}; }
1615
+ inline str
1616
+ #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 5
1617
+ operator " " _s // gcc 4.8.5 insists on having a space (hard error).
1618
+ #else
1619
+ operator " " _s // clang 17 generates a deprecation warning if there is a space.
1620
+ #endif
1621
+ (const char *s, size_t size) {
1622
+ return {s, size};
1623
+ }
1616
1624
} // namespace literals
1617
1625
1618
1626
// / \addtogroup pytypes
You can’t perform that action at this time.
0 commit comments