[LLVMbugs] [Bug 19060] New: variable template specialization is treated as only a declaration if its type has internal linkage

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 5 17:28:45 PST 2014


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

            Bug ID: 19060
           Summary: variable template specialization is treated as only a
                    declaration if its type has internal linkage
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++1y
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

We're failing to instantiate the initializer for a variable template
specialization if its type has internal linkage:

<stdin>:1:24: warning: variable 'var<<anonymous namespace>::S>' has internal
linkage but is not defined [-Wundefined-internal]
template<typename T> T var; namespace { struct S {} s = var<S>; }
                       ^
<stdin>:1:57: note: used here
template<typename T> T var; namespace { struct S {} s = var<S>; }
                                                        ^

The warning is sort of right: if we emit IR for 's', we emit it as 'external
global'.

-- 
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/20140306/46fa6b9a/attachment.html>


More information about the llvm-bugs mailing list