[LLVMbugs] [Bug 8095] New: -Wglobal-constructors false positive

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 6 15:15:14 PDT 2010


           Summary: -Wglobal-constructors false positive
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ori at avtalion.name
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

The following example gives a warning when -Wglobal-constructors is enabled:

struct Foo {
    int x;
    Foo(int x1) : x(x1) {}

void bar() {
    static Foo a(0);


clang++ output:

a.cpp:8:13: warning: declaration requires a global constructor
        static Foo a(0);

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list