Repository navigation
Commit f382299
committed
Suppress non-virtual destructor warnings in the generated headers
The ABI interface structs, the delegate structs, and the produce<D, I> vtable
adapters all have virtual functions and non-virtual destructors, which trips
C4265/C5204 on MSVC and -Wnon-virtual-dtor on clang. Consumers building at high
warning levels see hundreds of these (about 200 in a translation unit that
exercises implements<>, delegates, events, and the collection helpers).
None of those types is ever deleted. The only refcounted, heap-allocated type is
root_implements, and it already has a virtual destructor. Everything below it is
a non-owning subobject whose address is simply the COM interface pointer handed
out for that interface, so the warning reports a delete that cannot occur.
Emit a scoped push/disable/pop around the body of each generated header, using
the same guarded style already used in base_delegate.h, base_implements.h,
base_activation.h, and base_error.h. Because it is popped at the end of each
header, consumer code outside these headers is unaffected.1 parent 856eaff commit f382299
1 file changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
84 | 120 | | |
85 | 121 | | |
| 122 | + | |
86 | 123 | | |
87 | 124 | | |
88 | 125 | | |
| |||
108 | 145 | | |
109 | 146 | | |
110 | 147 | | |
| 148 | + | |
111 | 149 | | |
112 | 150 | | |
113 | 151 | | |
| |||
0 commit comments