http://llvm.org/bugs/show_bug.cgi?id=16888

            Bug ID: 16888
           Summary: [-cxx-abi microsoft] static local initialization
                    requires a guard variable
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
            Blocks: 12477
    Classification: Unclassified

Basically, MicrosoftCXXABI::EmitGuardedInit() needs work.  It has this comment:
  // FIXME: this code was only tested for global initialization.
  // Not sure whether we want thread-safe static local variables as VS
  // doesn't make them thread-safe.

Given that we can have inline functions with static locals, I believe we
actually need to match MSVC's behavior exactly down to the mangling of the
guard variable in order to be compatible.

I discovered this because LLVM's outs() has a static raw_fd_ostream for
STDOUT_FILENO, and currently we register its destructor once per call to
outs(), leading to assertions in the CRT on double-close.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to