Commit 5dc4a16
committed
[cppyy] Don't leak deprecation warnings when resolving enum types
Cppyy::ResolveEnum() determines an enum's underlying integer type by
JIT-compiling a probe expression of the form:
```c++
std::is_same<unsigned int, std::underlying_type<SomeEnum>::type>::value;
```
If the enum being resolved (or its enclosing scope) is marked deprecated,
this purely internal introspection emits a `-Wdeprecated-declarations`
warning to stderr. Since cppyy resolves enums while wrapping classes, the
warning surfaces in ordinary PyROOT sessions that merely touch a class
carrying such an enum.
This started breaking a range of roottest tests (which diff process output
against reference files) after the historical ESTLType/ESTLtype enum copies
in TClassEdit, TDictionary and TStreamerElement were deprecated.
Wrap the probe expression in clang diagnostic push/ignored/pop pragmas so
that resolving a deprecated enum stays silent.
🤖 Done by AI.1 parent 0edd975 commit 5dc4a16
1 file changed
Lines changed: 8 additions & 2 deletions
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
622 | 622 | | |
623 | 623 | | |
624 | 624 | | |
625 | | - | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
626 | 631 | | |
627 | 632 | | |
628 | 633 | | |
629 | | - | |
| 634 | + | |
| 635 | + | |
630 | 636 | | |
631 | 637 | | |
632 | 638 | | |
| |||
0 commit comments