STL: Consider consistently rephrasing Standard mode diagnostics

Created on 2 Nov 2019  路  3Comments  路  Source: microsoft/STL

When a header for a newer C++ Standard is compiled with an older Standard mode, it emits a diagnostic. Our phrasing varies; some talk about the contents of the header:

https://github.com/microsoft/STL/blob/28ec9a32952e0d7443936f8d5ae5d675ba6cf65c/stl/inc/charconv#L3101

Others talk about the main class or class template defined by that header:

https://github.com/microsoft/STL/blob/28ec9a32952e0d7443936f8d5ae5d675ba6cf65c/stl/inc/any#L445
https://github.com/microsoft/STL/blob/28ec9a32952e0d7443936f8d5ae5d675ba6cf65c/stl/inc/variant#L1754

Some don't bother to say "class" (and ignore the distinction between the basic_string_view class template and the string_view typedef):

https://github.com/microsoft/STL/blob/28ec9a32952e0d7443936f8d5ae5d675ba6cf65c/stl/inc/string_view#L15

And some have custom phrasing:

https://github.com/microsoft/STL/blob/28ec9a32952e0d7443936f8d5ae5d675ba6cf65c/stl/inc/execution#L5141

Should we be consistent about this phrasing?

enhancement fixed

All 3 comments

My preference: "The contents of <meow> are only available with C++MEOW or later." This is currently used by <charconv>, <compare>, <concepts>, <filesystem>, <memory_resource>, and <ranges>.

Didn't @BillyONeal suggest that we should invert the conditionals that guard these "downlevel" diagnostics so the #pragma is nearer the top of the header file? (Admittedly these are separable issues, but the level of "creep" from combining them seems small to me.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ohhmm picture ohhmm  路  32Comments

jonwil picture jonwil  路  24Comments

StephanTLavavej picture StephanTLavavej  路  12Comments

StephanTLavavej picture StephanTLavavej  路  10Comments

ohhmm picture ohhmm  路  16Comments