[SERVER-77924] Spurious warning ("note") from data_range.h about BSONElement::data Created: 08/Jun/23 Updated: 29/Oct/23 Resolved: 12/Jun/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Service Arch
|
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Service Arch 2023-06-12 |
| Participants: |
| Description |
|
This happens in a widely used header (data_range.h), so every build sees a LOT of these "note" lines, which can "cry wolf" and mask more legitimate warnings. This is a compiler "note". Compiler notes look like warnings but aren't. They're disruptive and probably easily avoidable perhaps with some improved metaprogramming.
The problem is that data_layer.h is trying to invoke the data member of T as a detection concept check. BSONElement has a data member, but it's a private const char*. The warning is "helpfully" suggesting that if you want to access the "data" member it's available with the "rawdata" accessor function. But that's not what we're interested in. We don't want BSONElement to be interpreted as a data layer ContiguousContainerOfByteLike at all. The old school concept check is here:
can be modernized significantly to C+17/C+20 detection idioms which could be designed to avoid triggering this "note". |
| Comments |
| Comment by Githook User [ 12/Jun/23 ] |
|
Author: {'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}Message: |