Closed
Description
Describe the bug
In C++20 a lot of the volatile keyword is being deprecated (P1152R3)
For example deallocate has this problem
To Reproduce
Steps to reproduce the behavior:
- Use a new compiler, fx gcc10
- Set CMAKE_CXX_STANDARD to 20
- Build
Expected behavior
Expected the build to complete
Desktop (please complete the following information):
- gcc version 10.1.0
Additional context
I ran into this problem because i am using jsoncpp in a project that was setting CXX_STANDARD to 20, and then when we upgraded gcc we were getting compile errors.
For example
jsoncpp-src/include/json/allocator.h:41:36: error: ‘volatile’-qualified parameter is deprecated [-Werror=volatile]
41 | void deallocate(volatile pointer p, size_type n) {
| ~~~~~~~~~~~~~~~~~^