[PATCH] D128726: [RISCV][NFC] Move static global variables into static variable in function.

Jessica Clarke via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 06:58:37 PDT 2022


jrtc27 added a comment.

Seems you're right, the C++11 standard does clearly say (9.7p4):

> Dynamic initialization of a block-scope variable with static storage duration (6.6.4.1) or thread storage duration (6.6.4.2) is performed the first time control passes through its declaration; such a variable is considered initialized upon the completion of its initialization. If the initialization exits by throwing an exception, the initialization is not complete, so it will be tried again the next time control enters the declaration. If control enters the declaration concurrently while the variable is being initialized, the concurrent execution shall wait for completion of the initialization. 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/D128726/new/

https://reviews.llvm.org/D128726



More information about the cfe-commits mailing list