You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the initialization of static variables within functions, based on comparison with assembly output and analysis, I believe that a call to __cxa_atexit should be included, otherwise the class object cannot be destructured on program exit.
The following references are used in the analysis process.
thanks for reporting this. As far as I can tell, you're right. The only thing is that __cxa_atexit requires parameters. C++ Insights doesn't show destructors as they are not part of the AST. I must figure out what I want to do in this special case. Of course, if you bring me a PR, I will most likely accept that :-)
Thanks for the reply, also if(!__tempGuard) should it be if((__tempGuard & 0xff) == 0) ? After all, here it should ensure that the initialization is complete, not continue the logic below while other threads are initializing.
Also __tempGuard = true; doesn't seem to be correct.
Here is the test code with what I think the output is.
For the initialization of static variables within functions, based on comparison with assembly output and analysis, I believe that a call to
__cxa_atexit
should be included, otherwise the class object cannot be destructured on program exit.The following references are used in the analysis process.
C++ Insights
Compiler Explorer
This function call is missing.
Translated with DeepL.
The text was updated successfully, but these errors were encountered: