[LLVMbugs] [Bug 14631] New: template-based global variables are not initialized properly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 18 00:47:14 PST 2012


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

             Bug #: 14631
           Summary: template-based global variables are not initialized
                    properly
           Product: clang
           Version: 3.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: robert at debian.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9715
  --> http://llvm.org/bugs/attachment.cgi?id=9715
Code snippet to reproduce the bug

clang fails to initialize global variable that is a template type based on
non-POD class.

The attached code snippet:
- compiled with g++ 4.7 displays

   IDX_int = 1444, IDX_WrappedInt = 1444

- but when compiled with clang++ 3.1 displays

   IDX_int = 1444, IDX_WrappedInt = 0


I've just tested with the latest available Debian version of clang, which is:
 Debian clang version 3.2-9 (tags/RELEASE_32/rc3) (based on LLVM 3.2)
 Target: i386-pc-linux-gnu
 Thread model: posix
and I can see the same behaviour.


Regards,
robert

-- 
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