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

David Majnemer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |INVALID

--- Comment #1 from David Majnemer <[email protected]> ---
You never provide a definition of your static member.

Adding a definition would make your program successfully link:

template <class T>
T foo<T>::static_member = T();

As to why it works when optimizations are applied: the optimizer realizes you
aren't using the 'static_member' variable and optimizes away the references to
it.

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