hubert.reinterpretcast added a comment. In D135919#3859491 <https://reviews.llvm.org/D135919#3859491>, @tahonermann wrote:
>> the case from https://github.com/llvm/llvm-project/issues/57828 is not for a >> block-scope variable, but the case in the patch description is... > > Thanks, Hubert. Yes, I found that the reported issue occurred for any case > where thread safe guard variables are not required. I chose the block-scope > variable example for the patch summary because I felt it better presented the > issue. > > Your question inspired me to do some additional testing though and I see both > gcc and icc also exhibit the re-initialization behavior for that case, but > not the case reported in https://github.com/llvm/llvm-project/issues/57828. For the block-scope case, https://eel.is/c++draft/stmt.dcl#3: If control re-enters the declaration recursively while the variable is being initialized, the behavior is undefined. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135919/new/ https://reviews.llvm.org/D135919 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits