Diagnose problematic uses of constructor/destructor attribute (#67360)
Functions with these attributes will be automatically called before `main()` or after `main()` exits gracefully, which means the functions should not accept arguments or have a returned value (nothing can provide an argument to the call in these cases, and nothing can use the returned value), nor should they be allowed on a non-static member function or consteval function in C++. We allow 'int' as a return type for the function due to finding a significant amount of historical code using `int(void)` as a signature. Additionally, these reuse the same priority logic as the init_priority attribute which explicitly reserved priorty values <= 100 or > 65535. So we now diagnose use of reserved priorities the same as we do for the init_priority attribute.
parent
6716d3dd
Please register or sign in to comment