[LLVMbugs] [Bug 19035] New: Explicit instantiated variable template leads to miscompile

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 3 22:32:24 PST 2014


            Bug ID: 19035
           Summary: Explicit instantiated variable template leads to
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++1y
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


template <typename = void>
int x{42};

template <>
int x<>;

int y = x<>;

this has the strange result of giving both x<void> and y the value zero.

AFAICT, this is caused by a lack of sufficient instantiation of the initializer
when we explicitly instantiate x.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140304/cff0dd72/attachment.html>

More information about the llvm-bugs mailing list